I need to change the following script from a submithandler to an onchange event
I have a form with a select (list) that currently works on a submit button. and loads the results into a div. I need this form to submit when a user selects from the list box and do everything else the same as shown
$(document).ready(function(){
$("#viewCus").validate({
debug: false,
submitHandler: function(form) {
$.post('customers_view.php', $("#viewCus").serialize(), function(data) {
$('#mainBody').html(data);
////////This executes the JavaScript passed back by the ajax.
$("#mainBody").find("script").each(function(i) {
eval($(this).text());
});
////////*$("form#ncus")[0].reset();*/
});
}
});
});
Many thanks :)