I have this form in my HTML:
<form action="/awe/ChangeTheme/Change" method="post" name="myForm" id="myForm">
<select id="theme" name="theme">
<option value="blitzer">blitzer</option>
</select>
<select id="author" name="author">
<option value="blitzer">blitzer</option>
</select>
</form>
Anybody knows how to submit it when a value is selected in the 'themes' dropdown?
The other solutions will submit all forms on the page, if there should be any. Better would be:
$(document).ready(function() {
$('#theme, #author').on('change', function() {
document.forms['myForm'].submit();
});
});
0 Comments