Disabling HTML5 validation. How to set 'novalidate' for every form globally?

懵懂的女人 提交于 2019-12-07 05:49:25

问题


I'm wonder if I could set something to disable html5 validation for every form in my application. Is there any way to do this or I just should add novalidate attribute for each form tag?


回答1:


It seems the only way is to add novalidate attribute to each form using javascript/jquery, like this:

$(document).ready(function() {
    $("form").attr('novalidate', 'novalidate');
});


来源:https://stackoverflow.com/questions/17828699/disabling-html5-validation-how-to-set-novalidate-for-every-form-globally

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