Hiding and showing fields still validates hidden fields with ASP.NET MVC 2 Client Side Validation -


i've got form part of e-commerce checkout process has section billing address allows user use delivery address or fill in address in form. if user selects use delivery address don't show address fields.

i've added validation fields on server side check option selected , remove validation errors fields hidden. works fine on server site i'd use mvc 2's client side validation , need way of doing same on client side.

what i'd way of getting javascript validation ignore hidden fields. there way of doing or case of hacking microsoftmvcjqueryvalidation.js file?

jquery validation ignore hidden's?

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

elements can considered hidden several reasons:

  • they have display value of none.
  • they form elements type="hidden".
  • their width , height explicitly set 0.
  • an ancestor element hidden, element not shown on page.

source: here


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -