I'm trying to figure out how unobtrusive validation works in asp.net mvc 3.
I would like to know what is triggering the validation check when I click to submit the form. How is the script jquery.validate.unobtrusive.js bound to the form submit event ?
I also would like to know how can I manually prevent/trigger this check.
jquery.validate.unobtrusive
is a validator for jquery.validate
. It is like a extension.
jquery.validate.unobtrusive
implements all the events and jquery.validate
use it.
You can look into the jQuery.validate.js file and see that it uses the submit of the form.
// validate the form on submit
this.submit( function( event ) {
...
If you want to trigger the validation by yourself you can call
$("#myform").valid()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With