I am using jquery validation plugin.
In my form, I need to check if the nickname is used or not.
To do this, they provide a remote key to call ajax. For me, the ajax call works correctly and returns true or false. But its resolution, even if the return value is false, should not happen.
My verification code looks like
$(function() { $("#myform").validate({ rules: { fullName: { required: true, minlength: 5 }, nickName: { required: true, minlength: 4, alphaNumeric: true, remote: { url: "NickNameChecker", type: "post", data: { nickName: function() { return $("#nickName").val(); }}, success: function(data) { return data; } } } }, messages: { fullName: { required: "Please Enter Your Full Name.", minlength: "Full Name should have minimum 5 letters." }, nickName: { required: true, minlength: "Nick Name should contain minimum 4 letters.", remote: "This nickname is already in use." } } }); });
Any suggestions would be appreciated !!!
Thanks!
Decision:
The solution is only in my code.
I just deleted some of the success and tried. It works great!
user405398
source share