View Full Version : conditional dynamic / visible form elements

03-11-2005, 03:29 PM
I'm attempting to create a form that will show an additional select form element if the user selects one particular option from the select form element above it. For instance, Element 2 should be hidden unless option3 is selected in Element 1.

This should be a relatively straightforward conditional in javascript that checks the value of element 1 and if it equals option 3's value then Element 2 becomes visible.

Thanks in advance.

03-22-2005, 03:59 PM
I have the exact same question...
I too am trying to build a dynamic form with conditional elements (appearing only if this element is checked or if this element's value is x...)

I thought I could alter the code from the dynamic drop down code found here (http://www.texaswebdevelopers.com/examples/our_supplier_in.asp), but no go.

I too would greatly appreciate any assistance with this one.


Just like pwdavis, I'm trying to set this up so (for example) if the user clicks a checkbox, another element appears - and if they uncheck the checkbox, that same element will disappear. I have seen this done before, but can't for the life of me remember where.

03-23-2005, 10:29 AM
As I just posted in another thread (http://www.dynamicdrive.com/forums/showthread.php?t=2167), this subject has been done to death on Usenet. If the link in that thread doesn't help, you can always take a look through the comp.lang.javascript archives (http://groups.google.co.uk/groups?q=group%3Acomp.lang.javascript) yourself (remember to select the "Search only in comp.lang.javascript" radio button).