$(function () {
$("#dropdown").live("change keyup", function () {
$("#theform").submit();
});
});
<form method="GET" id="theform" action="">
<select name="dropdown" id="dropdown">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3" id="nosubmit">Three</option>
</select>
</form>
If option three is selected, I want to reveal another dropdown (without submitting the form):
<form method="GET" id="theform2" action="">
<select name="dropdown2" id="dropdown2">
<option value="4">Four</option>
<option value="5">Five</option>
<option value="6">Six</option>
</select>
</form>
What would I have to do to NOT have it auto submit if one particular option is selected? Also when that option is selected how would I know? I need to reveal another dropdown in that case.
In your jQuery that watches for events, you just have to do a little checking before you go forward with submit().
Please note that you shouldn’t put the #dropdown2 select into it’s own form, unless you only want to submit one set of data or the other. If you want it all to go together, put it inside a single form.