ASP.NET MVC 3 jQuery client validation - disable for specific button (Ajax form)

丶灬走出姿态 提交于 2019-12-11 08:29:48

问题


How can I disable validation for one button inside the Ajax begin form?

Using jQuery validation I tried many ways from Google, but none of them worked (class="cancel", disableValidation attribute, etc.).


回答1:


There may be other ways, but one for sure way is to remove all the validation rules if using unobtrusive validation via:

http://docs.jquery.com/Plugins/Validation/rules#.22remove.22rules




回答2:


$('#frmMyName').validate().cancelSubmit=true;


来源:https://stackoverflow.com/questions/6240898/asp-net-mvc-3-jquery-client-validation-disable-for-specific-button-ajax-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!