I pretty new with MVC3 but i’m already learning how handle custom validation, and client-server. But what happens if instead of using jquery-validate for the validations on client side I want to use another plugin called jquery-validation engine. How to start?
I pretty new with MVC3 but i’m already learning how handle custom validation, and
Share
Well you start by turning off unobtrusive validation:
and removing all references to
jquery.validate.jsandjquery.validate-unobtrusive.jsscripts from your page. Then you read the documentation of the plugin you are willing to use, try out some of the demos, download the plugin, import required scripts to your page and you start attaching to your form elements. Don’t expect miracles. There is nothing that will replicate your server side validation rules defined by data annotations on the client unless you write the code for yourself.If you keep the
ClientValidationEnabledparameter totruein your web.config the Html helpers will continue to emit HTML-5 data-* attributes that you could use to dynamically define your client validation rules based on the server validation rules (the same wayjquery.validate-unobtrusive.jsdoes it). So you could write your ownjquery.validation-engine-unobtrusive.jsfile.