I have a form with multiple fields that when submitted, the results are retrieved via ajax on the same page. This works perfectly. However, to retrieve the results you have to press a button, submitting the form.
I would like it so that if any of the fields are changed, the results are updated without having to press the button, kind of like a search filter. There are currently several text fields, a couple of dropdowns and there will be a few checkboxes.
The form is currently processed using the attached code.
var range = $("#range").val();
var subcat = $("#subcat").val();
var colour = $("#colour").val();
var size1 = $("#size").val();
var dataString = 'range='+ range + '&subcat=' + subcat + '&colour=' + colour + '&size=' + size1;
$("#results").empty().html('<img src="/images/ajax-loader.gif" class="loader" />');