jquery validation of text field not firing ajax request for valid entry
I have a text field(email) in my form which checks whether the entered
value is valid, if so then it will have to validate the same again my DB.
The problem is that when I type wrong its not displaying the error message
that I have configured under message, instead it chooses over the default
msg.
$("#myform").validate({
rules: {
email:{
required: true,
email: true,
type: "post",
remote:{
url:"myservlet?verifyEmail=checkEmail",
/* data: "verifyEmail=checkEmail", */
type: "post",
}
},
messagess:{
email:{
required: "Enter a valid email",
remote: "This user is already taken"
}
}
},
highlight: function(element){
$(element).closest('.control-group').removeClass('success').addClass('error');
},
success: function(element){
element
.closest('.control-group').removeClass('error')/*
.addclass('error') */;
}
});
if(('#myform').validated())
('#myform').submit();
I tried to check the network traffic i dnt see any traffic due to this
request. The bootstrap class configured under highlight and success is
working fine. This is my first time using this plugin.
No comments:
Post a Comment