Disable validation for an element with jQuery Unobtrusive Validation

后端 未结 3 796
忘掉有多难
忘掉有多难 2020-12-14 11:05

I am generating a list of elements on a page, and they all have validators attached to them. When I look in the HTML source, I see something like:



        
3条回答
  •  时光取名叫无心
    2020-12-14 11:40

    This worked better for me:

    $('#Reference').rules('add', 'required');
    $('#Reference').rules('add', 'remove');
    $('#Reference').rules('add', { minlength: 2 });
    

提交回复
热议问题