Client validate non-model bound checkbox while using MVC 2 jQuery Validation
Posted
by
Justin Saraceno
on Stack Overflow
See other posts from Stack Overflow
or by Justin Saraceno
Published on 2011-01-15T03:58:55Z
Indexed on
2011/01/15
19:53 UTC
Read the original article
Hit count: 157
asp.net-mvc
|jquery-validate
Have: Using ASP.NET MVC 2, DataAnnotationsModel based server validation, and client validation with jQuery. Anything in my model is validated perfectly on the client with jQuery based validation (jQuery.validate and MicrosoftMvcJQueryValidation.js).
Need: Adding an additional HTML <input type="checkbox" id="terms" />
to my form. I need jQuery validation to require that this checkbox is checked AND somehow hook it in with whatever jQuery client script MVC is automagically controlling. Yes, I know it won't validate on the server side, but I don't need or want it to.
Seems like it should be simple but I'm new to MVC, a total beginner at jQuery, and my searches have been coming up blank.
Any help would be appreciated!
© Stack Overflow or respective owner