PDA

View Full Version : Multiple Questions question!


jonathanbull33
11-16-2002, 11:01 AM
I am currently creating a website with multiple answer questions. When you click on the wrong answer that one will disappear, if you click wrong again then that answer will disappear leaving 2 answers, and so on!

Every time it will say a comment above like 'try harder' or something like that and once the correct answer is clicked the user will be taken to a 'congratulations' page.

I've been told its possible to do this using javascript but I've no idea how!

The effect i am looking for is very similiar to
http://www.zerotv.com/namegame/index.cfm?game=2

If anyone could help with this problem i would be very grateful!

Many thanks,
Jonathanbull33

shivboy
11-16-2002, 05:49 PM
ok, well that's do-able. put those radio buttons in layers and turn the visibility of the layers to hidden every time a wrong button is clicked, and at simultaneously, u put the message "Incorrect, try again next time" or "congratulations" in separate layers. if the wrong button is pressed, u make that layer disappear and make the relevant message layer appear.

RadarBob
11-16-2002, 08:12 PM
OK, let's see if I can do this from memory...

In as much as layers is NN functionality, not IE, how about this...

Surround each individual answer-tag with a <span> tag. Set the visibility attribute of the span tag, default to 'visible'. I forget if the visibility is actually a style="visibility: hidden" thing or not. The onclick event for each answer-tag calls a function that checks for the wrong answer. If it's wrong, set the visibility attribute for it's <span> tag to 'hidden'

Note that the web page will not close up the space when the answer disappears. The thing is still there, just invisible and untouchable with the mouse.

jonathanbull33
11-16-2002, 11:06 PM
Thankyou for your replies,

I am sorry, but as I am a beginner to Javascript, I am not quite sure how to do this. How can i set up a function to check for the correct answer?

Thanks again,
Jonathanbull33