Forum Moderators: phranque

Message Too Old, No Replies

Help With Forms

         

jhubb

5:27 pm on Nov 26, 2004 (gmt 0)

10+ Year Member



Hi, I've been reading all the forms tutorials I can find on the web, but they only give the basic info I already know.

What I'd like to do is have a selector (drop-down list), and depending on what is chosen on that list, display the next question.

For example, the question is "What type of ad are you placing?" If the user chooses "personal," I want the questions related personal ads to appear next on the form. If they choose "commercial," I want that set of questions to appear instead.

How is this done? If you have a resource on the net, just point in the right direction.

Thanks!

dmorison

9:15 pm on Nov 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi jhubb,

Effects like you describe are achieved using a combination of JavaScript and DHTML (Dynamic HTML).

You will find plenty of tutorials and references for both.

This will make more sense once you've read up on the above, but the basic principle is that you use the onchange event of the drop down box to either re-write the content of the next form element, or to display and hide entire <div>'s using thier style's "visible" property.

Hope this helps!

jhubb

7:42 pm on Nov 29, 2004 (gmt 0)

10+ Year Member



Yes, very helpful. Thanks!