What launches unobtrusive validation validation in asp.net MVC 3

I am trying to understand how unobtrusive validation works in asp.net mvc 3.

I would like to know what triggers the validation check when I click the button to submit the form. How is jquery.validate.unobtrusive.js script attached to form submit event?

I would also like to know how I can manually prevent / run this check.

+6
source share
1 answer

jquery.validate.unobtrusive is a validator for jquery.validate . This is like an extension.

jquery.validate.unobtrusive implements all events and jquery.validate uses it.

You can view the jQuery.validate.js file and see what form it uses.

 // validate the form on submit this.submit( function( event ) { ... 

If you want to call validation yourself, you can call

 $("#myform").valid() 
+8
source

All Articles