By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,568 Members | 1,194 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,568 IT Pros & Developers. It's quick & easy.

Dynamic survey

P: n/a
I am trying to make a survey with a number of questions in it. To start
with just the first question is shown, with two possible answers.
Depending on which answer is chosen another question will show up when
the user clicks on the radio button. Then, again, with this next
question the same thing would happen.

I have almost got it working. I put each question in a DIV and made
them visible onclick of radio button. The only problem with this is
that when question 2 is answered the next question shows up BUT
question 2 disappears, which i want to stay visible.

I imagine the best way is the have the onclick action of the
radiobutton make two DIVs visible, but with teh code i have it can only
accept one.

Does anyone have any ideas?

Aug 30 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
chris_huh said the following on 8/30/2006 8:10 AM:
I am trying to make a survey with a number of questions in it. To start
with just the first question is shown, with two possible answers.
Depending on which answer is chosen another question will show up when
the user clicks on the radio button. Then, again, with this next
question the same thing would happen.
I hope there aren't more than 4 or 5 questions then. As your possible
questions is directly - and exponentially - related to how many
questions there are.

8 questions have 256 possible outcomes. That is a lot of questions/DIV's
to be hiding for no apparent reason.
I have almost got it working. I put each question in a DIV and made
them visible onclick of radio button. The only problem with this is
that when question 2 is answered the next question shows up BUT
question 2 disappears, which i want to stay visible.
Then something is obviously wrong in your code. Show a sample page that
you have so far.
I imagine the best way is the have the onclick action of the
radiobutton make two DIVs visible, but with teh code i have it can only
accept one.
Actually, a "better way" would be to have the next elements to show
dynamically created and inserted to containers.
Does anyone have any ideas?
Lots of them. They start at 2.95 USD each. How many can I put you down for?

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Aug 30 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.