Reputation: 209
$.validator.addMethod("noanon", function(value) {
return ajaxFunction();
}, 'Username already exists.');
The addMethod function takes 3 arguments. A name, the logic to actually run, and lastly, the default message to use for failures.
name: {
required: true,
minlength: 2,
noanon: true
},
Now if I use the ajaxFunction, there sems to be some error which is appearing.
Upvotes: 0
Views: 447