Validate a Hidden Field

前端 未结 3 1123
無奈伤痛
無奈伤痛 2021-02-04 04:57

I\'m using MVC3 with unobtrusive validation. I have a field that the user is expected to fill with some data and then press a \"search\" button. If search has never been pressed

3条回答
  •  南旧
    南旧 (楼主)
    2021-02-04 05:29

    try

       var validator = $("#myFormId").data('validator');    
       validator.settings.ignore = "";
    

    Here is an informative blog post

    EDIT

    @RAM suggested a better solution please FOLLOW

提交回复
热议问题