我正在使用 jQuery 验证,代码如下:
$("#demo").validate({
rules : {
password : { required : true, },
password2 : { required : true, },
},
messages: {
password : { required: "This field is required.",},
password2 : { required: "This field is required.",},
},
submitHandler: function(form) {
$( "#dialog-confirm" ).dialog({
autoOpen: true,
resizable: false,
height:250,
width:500,
modal: true,
buttons: {
OK : function(form) {
form.submit();
}
}
});
},
});
我想要做的是将form
fromsubmitHandler
函数传递给按钮对象函数。一旦他们点击确定,它就会提交表单。