I have been trying to do some staffs. I am trying to submit a form using jQuery. Here is my code. Please take a look at them.
My aim is that when a user clicks on any drop down option the form will be submitted then. I have been searching for a long time but can't find solution of my specific problem. If you find this question similar to any other question asked please comment the link.
I am kinda new in jQuery. Any help will be appreciated.
HTML:
<form method="post" action="#" id="opart">
<select name="sort_out" class="sort_tool">
<option value="low-price">Sort Out Products By...</option>
<option id="oparst" value="high-price">Price High to Low</option>
<option value="low-price">Price Low to High</option>
<option value="low-model">Model Name A-Z</option>
<option value="high-model">Model Name Z-A</option>
<option value="low-brand">Brand Name</option>
</select>
</form>
jQuery:
$('#oparst').click(function(){
$('#opart').submit();
});