jQuery Validate - Enable validation for hidden fields

后端 未结 9 1780
忘了有多久
忘了有多久 2020-11-21 22:27

In the new version of jQuery validation plugin 1.9 by default validation of hidden fields ignored. I\'m using CKEditor for textarea input field and it hides the field and re

9条回答
  •  臣服心动
    2020-11-21 22:47

    This worked for me within an ASP.NET site. To enable validation on some hidden fields use this code

    $("form").data("validator").settings.ignore = ":hidden:not(#myitem)";

    To enable validation for all elements of form use this one $("form").data("validator").settings.ignore = "";

    Note that use them within $(document).ready(function() { })

提交回复
热议问题