1
Guys, I have this code that I’m using to search for server validations and display in the jquery validation plugin that I use.
function nomeExiste(value, validator, $field) {
var retorno;
$.ajax({
url: '/saboia/funcionarios/'+$field.val()+'/validaNovo/',
method: 'PUT',
success: function(e){
console.log(e);
retorno = e;
}
});
if (!retorno) {
return false;
}else{
return true;
}
}
The return of this function comes from the server and is a boolean, however, when I run this function it enters directly into the if’s and ends up that the return assignment within ajax is "ignored", because it happens?
Opa Rafa, thanks for the reply, I will test here and give you the return ok? And merry Christmas!
– user62618