Anuj TBE Anuj TBE - 1 year ago 97
jQuery Question

Submit form on change of input field

I have a form with multiple input checkbox fields. I want to trigger form submit on change in any of the checkbox without submit button.

<form action="" method="get">
<input type="checkbox" name="p[]" value="1">
<input type="checkbox" name="p[]" value="2">
<input type="checkbox" name="p[]" value="3">

How it can be done with jQuery?

Answer Source

You can hook to the change() event of the checkboxes, then fire a submit() on the form:

$('form input').change(function() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download