为什么提交处理程序不适用于2个以上的输入标志(' ab'等)? 错误存根运行,但没有OK结果。 http://jsfiddle.net/v1ojjnnk/
<form id="userForm">
<div id="login">
login
</div>
<div>
<label>
<input type="text" id="loginField" name="name">
</label>
</div>
<div>
<label>
<button id="register" type="submit">go</button>
</label>
</div>
</form>
var $loginField = $('#loginField');
$('#userForm').validate({
errorPlacement: function (error, element) {
alert('error stub');
},
success: function (label, element) {
alert('good stub');
},
rules: {
name: {
required: true,
minlength: 1
}
},
submitHandler: function () {
alert('OK stub');
return true;
}
});