【发布时间】:2015-10-29 11:36:28
【问题描述】:
我正在使用 Jquery formValidation 插件来验证我的表单。当我单击提交按钮时,一切正常,它在验证后提交表单。但是当我在键盘上按 Enter 键时,它仍然验证表单并且不提交表单并且表单值消失了。我需要在这里写代码吗?我猜它正在工作,但没有听 Enter 键被按下?
$('#login_form').formValidation({
message: 'This value is not valid',
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
email: {
validators: {
notEmpty: {
message: 'The email address is required'
},
emailAddress: {
message: 'The input is not a valid email address'
}
}
},
password: {
validators: {
notEmpty: {
message: 'The password is required'
}
}
}
}
});
【问题讨论】:
标签: javascript jquery formvalidation-plugin