简体   繁体   中英

dynamic jQuery validation

I have a form with 10 inputs/selects (ASP.NET MVC3)

Validation, validation is done by data attributes and jquery.validate.min.js and jquery.validate.unobtrusive.min.js (I don't use any custom .submit() function for it)

The logic is that some fields has to be required on not required based on selected values in othe fields.

The question is: how to enable/disable validation for specific input from JavaScript.

$("#myform").validate({ ignore: ".ignore" })

http://docs.jquery.com/Plugins/Validation/validate

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM