I have a form in my page like the one below;
<form name="testform" id="testform" action="test.php" method="get">
<input name="field1" id="field1" type="text" value="">
<input name="field2" id="field2" type="text" value="">
<select name="dropdown" id="dropdown">
<option value="option1" selected="selected">option1</option>
<option value="option2">option2</option>
<option value="option3">option3</option>
</select>
<input type="submit" name="Submit" value="Submit" id="Submit">
</form>
I want the form to get submitted automatically when user select an option from the drop-down menu. How can I do this with or without using JavaScript (with or without jQuery)?
Thanks in advance… :)
blasteralfred
Click (or select)? In that case the user would not be able to make any selection. You probably mean as soon as another option is selected. If so
If jQuery is being used, unobtrusive event handler change should be used instead of inline javascript.
Use on if the form elements are dynamically being added in the DOM