[英]WkWebView Message handler doesn't return the value of textbox first time, but it does the second time I press the button
[英]Jquery Validation does not start if mouse doesn't leave textbox the first time
我只是开始使用jquery验证插件,而且我使用的是最简单的表单(请参阅链接)。但是,我注意到一个我无法得到答案的问题,我尝试搜索一个完全不同的问题地方
重现步骤1.单击进入名称教科书2.输入任意数量的字母(例如abc)3.退格所有内容4.单击或跳至下一本教科书
这样,jquery验证就不会启动,这不是我想要的必需规则。 请帮助,并非常感谢!
JavaScript代码
$(document).ready(function(){
$("#form").validate({
ignore: "",
rules: {
name: {
required: true
}
},
messages: {
name: "Required Field"
}
});
});
和HTML
<form id="form" method="" action="">
<label for="name">Name</label>
<div><input type="text" id="name" name="name"> </div>
<label for="what">What</label>
<input type="text" id="what" name="what">
</form>
我认为这是正常行为。 如果添加提交按钮,则验证将在用户尝试提交表单时触发。 如果要对模糊强制验证,可以将其添加到验证配置对象:
onfocusout: function(e) {
this.element(e);
},
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.