Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Banned
    Join Date
    Jun 2002
    Location
    Earth.
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How do I make a quiz that will take people to different pages depending on the answer

    Long title I know; sorry bout that. Anyway, I want to make a quiz that will take people to different pages depending on they're answers. Like if the quiz was which color is your favorite and there was questions like: What is your favorite thing on earth? A. The sky. B. The sun. Or C. The grass. And if the person picked the sky their favorite color would be blue and it would take them to a page saying their favorite color was blue. How do I do that? I've looked at codes from other people pages, but they are confusing because I have no idea how they work . Please help!

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    for a start make a page called blank.html and leave it blank(youll need it later)

    now here the page you will hve the questions on(call it what you like)

    <head>
    <script>
    function pickcolor(clr)
    {

    infowin = open("blank.html","","") //opening blank page

    if (clr = "sky") // if function has been caled with clr as sky then....
    {
    infowin.document.write("your fav color is blue") //write your fav color is blue
    }

    else
    if (clr = "sun")
    {
    infowin.document.write("your fav color is red") //same as last time exept with different color
    }

    }
    </script>
    </head>

    <body>
    <a href="javascriptickcolor('sky')">the sky</a>
    <a href="javascriptickcolor('sun')">the sun</a>
    </body>

    tell me if that isnt clear
    photoshop too expensive? use the GIMP! www.gimp.org

  • #3
    Banned
    Join Date
    Jun 2002
    Location
    Earth.
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb

    That's not the kind of quiz I was looking for. This one is just done with hyper links. Oh well, I can always just do a simple text quiz. That'll be easier anyway. Thanks for trying.


    Last edited by Catz228; 06-22-2002 at 07:57 PM.

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well what kind of quiz are you looking for then?
    photoshop too expensive? use the GIMP! www.gimp.org

  • #5
    Banned
    Join Date
    Jun 2002
    Location
    Earth.
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, I was looking for something like this one http://violeteyes.org/tests/fruit/fruittest.html except I don't care about the colors.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that is a real pain to check radio boxes and which are selected. you had better try to use combo boxes

    <head>
    <script>
    function checkcolor()
    {

    clr = document.the_form.choice.options[the_form.choice.slectedIndex].value

    if (clr = "sky")
    {location.href = "blue.html"}
    else
    if (clr = "sun")
    {location.href = "red.html"}

    }
    </script>
    </head>

    <body>

    <form name="the_form">
    <select name="choice">
    <option value="sky">the sky</option>
    <option value="sun">the sun</option>
    <input type="button" value="send" onclick="checkcolor()">
    </select>
    </body>

    that should help you out
    photoshop too expensive? use the GIMP! www.gimp.org


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •