これは私の検証コードです
$('#reg_form').validate({
onkeyup: false,
errorClass: 'error',
validClass: 'valid',
rules: {
username: {
required: true,
minlength: 5,
//remote: "checkusername.php"
},
password: {
required: true,
minlength: 5,
},
confirm_password: {
required: true,
minlength: 5,
//equalTo: "#password",
},
secretQuestion: "required",
secretAnswer: "required",
emailId: {
required: true,
email: true,
remote: "checkemail.php"
},
termsConditions: "required",
},
messages:{
username: {
required: "Please enter Username",
minlength: "Please enter atleast 5 characters",
},
password: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long"
},
confirm_password: {
required: "Please provide a password",
minlength: "Your password must be at least 5 characters long",
//equalTo: "Please enter the same password as above"
},
secretQuestion: "Please select your question",
secretAnswer: "Please enter your secret answer",
emailId: {
required: "Please enter a valid email address",
remote: "Email is aleardy is exists! please try with onother",
},
termsConditions: "Please accept our Terms and COnditions"
},
highlight: function(element) {
$(element).closest('div').addClass("f_error");
},
unhighlight: function(element) {
$(element).closest('div').removeClass("f_error");
},
errorPlacement: function(error, element) {
$(element).closest('div').append(error);
}
});