-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Description
账号:<input name="loginName" type="text" />
密码:<input maxlength="20" name="pwd" type="password" />
确认密码:<input maxlength="20" name="confrimPwd" type="password" />
真实名称:<input name="name" type="text" />
<span class="msg-box n-right" style="display:none;" id="msg-register">
<span class="msg-wrap n-error" role="alert">
</span>
</span>
<button type="submit">注册</button>
</form>
$('#submitForm').validator({
showOk: false,
loadingMsg: '',
ignore: ':hidden',
target: '#msg-register',
stopOnError: true,
fields: {
loginName: 'required;',
name: 'required;',
pwd: 'required;',
confrimPwd: 'match(pwd);'
},
valid: function () {}
});
代码如上,密码不相同时,离开确认密码文本框时,错误信息会显示,不会消失。但是点击提交按钮时就会出现错误信息闪一下就消失的情况。但是如果把confrimPwd的match移到pwd里,就不会出现那种情况。由上匹配下没问题,由下匹配上就会出现问题
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels