Hello,
I want to make an Ajax call to check a value. I made this an it's work, but the script run and don't wait call's result...
I' dont see how to process to waiting the result of my call and return false or true
$.validator.addMethod(
"callAjax",
function(value, element) {
$.ajax({
method: "POST",
url: myURL,
data: {
myData: myData
},
dataType: "json"
})
.fail(function() {
return false
})
.done(function() {
return true
})
}, "Error"
);
Any idea?
thank a lot