我使用Jquery validation plugin,在我的网页中我想要这样做,默认情况下会禁用提交按钮,但是当表单有效时我想启用提交按钮,我就是; m如下所示,但在验证表单后,按钮未启用,缺少
$(document).ready(function() {
$('#save').attr('disabled', true);
$('#myform').validate({
errorClass: 'error',
success: function() {
$('#save').attr('disabled', false);
},
rules: {
termsCons: {
required: true
}
},
messages: {
termsCons: {
required: "${message(code:'sherif.jqueryValidation.required')}"
},
},
submitHandler: function(form) {
$('#save').attr('disabled', false);
}
});
});