I’m trying to have a dropdown menu that when the user chooses a specific value, it can produce an additional input box or checkbox or any other type of input. each value could can show different results, or none at all. and when the values change, so do the options.
Anyone have a suggestion or link i can read?
EDIT
Here kinda what I mean in case the above made no sense.
<select name="type" onchange="jqueryfunction('pass_selected_option')">
<option value="fooa">Add 2 Texboxes</option>
<option value="foob">Add 3 radios</option>
<option value="fooc">add 2 checkboxes and 2 textboxes</option>
</select>
You can do it like this:
Take a look at this jsfiddle for working example: http://jsfiddle.net/v7yHU/
Updated to be more elegant and detach your html from logic.
HTML:
JavaScript:
Working sample: http://jsfiddle.net/v7yHU/3/
With this js you can have n options in select, no need to change script.