我正在使用以下代码:
$().ready(function() {
$('#state_form').validate({
rules: {
state: "required"
},
messages: {
state:
{
required: "The State is required!"
}
},
errorPlacement: function(error, element) {
alert(error.html());
}
});
});
Run Code Online (Sandbox Code Playgroud)
但如果用户提交表单,则会出现弹出错误.这是对的.然后,如果用户单击选择框"状态",则仍会显示带有错误的弹出窗口(无法选择正确的值).真实的例子可以在janzitniak.info/temp/test.php上找到
这是不可接受的.我怎么能解决这个问题?
JQuery表单验证中描述的解决方案带有警告弹出窗口 - 警报仍然显示有效提交没有帮助我,也许我没有正确理解.