Hi again! I've been breaking my head with this, I have this custom validation that I know for a fact is getting the right value from the data_read (true or false) but since ajax is asynchronous the validation fails to get the value...
I saw in a lot of posts recommendations about using ajax to run a data_read but even if I use "async:false" the value is not returned hence the validation fails, I don't know any other way to fetch data from the db to a js function... all I need is to check if the string written by the user is already in the db to prevent a duplicate, (I know this could be done on the submit but that's not the idea)...
Any suggestions?
😲😲😲 HELP PLEASE!!! 😲😲😲
jQuery.fn.form.settings.rules.fmnem = function(value){
var clientx = jQuery("select#client option:checked").val();
jQuery.ajax({
url: '{url:search}&tvout=view',
data: {client:clientx, nem:value},
success: function(result){
console.log("Return: "+result);
return result;
}
});
};
I saw in a lot of posts recommendations about using ajax to run a data_read but even if I use "async:false" the value is not returned hence the validation fails, I don't know any other way to fetch data from the db to a js function... all I need is to check if the string written by the user is already in the db to prevent a duplicate, (I know this could be done on the submit but that's not the idea)...
Any suggestions?
😲😲😲 HELP PLEASE!!! 😲😲😲