On submission of 2nd form, first form is being validated ,both forms are independent having separate submit buttons and both are validated using jquery validator plugin.
here is my code :
$("#addVehicleForm,#discountInfoForm,#ihqform,#saveReturnForm,#driversForm").validate({
// stuff here
)}
#saveReturnForm
,#driversForm
these are the id's which i am passing in same validator
plugin method
.
I am trying to validate by click like this :
$("#my-submit-button-name").click(function(){
$(this).submit();
})
Note : Both form has different submit button
I use jQuery Validate on almost every project. I wrote the following statement to run validation on every form. The key is the
each()
statement. Theeach()
statement allows you to runvalidate()
on each form element separately.Or in your case
Also, if you have custom buttons to submit the forms you can do this. But you should probably just use
<input type='submit' value='Submit' />