I have the following form. And the form works. Now I want to auto-submit the form when I select one of option.
<div id='weeksubmit'><!-- I don't need this div -->
<form action="http://localhost/myapplication/index.php/courses/admin/index" method="post" class="autosubmit">
<label for='weekid'>Select Week</label>
<select name="weekid">
<option value="1">Uke 40 (04/10 - 10/10)</option>
<option value="2" selected="selected">Uke 41 (11/10 - 17/10)</option>
<option value="3">Uke 42 (18/10 - 24/10)</option>
<option value="4">Uke 43 (25/10 - 31/10)</option>
</select>
<input type="submit" name="submit" value="Change Week" /></form>
</div>
I tried the following code, but it does not work.
Could anyone tell me what I am doing wrong?
Thanks in advance.
$(".autosubmit select").change(function() {
$(this).submit();
});