jQuery: submit a form when the checkbox is selected -
i have form, , want automatically update when click on checkbox. current code:
$('.option img').click(function() { $("#views-exposed-form-portfolio-page-1").submit(); });
however, selected checkbox not stored before form submitted, , selection has not effect.
thanks
$("#mycheckbox").change( function(){ $("#views-exposed-form-portfolio-page-1").submit(); } );
you can check , see if checkbox checked before submitting form, way easier submitting based on click event (which fires before change event, seems).
Comments
Post a Comment