I have been trying to create a check user system to prevent duplicates. The code below returns true or false correctly but for some reason it is not triggering the error class system to display the error.
JavaScript
$(document).foundation({
abide : {
validators: {
checkUser: function(el, required, parent) {
var result = $.ajax({ type: "GET", url: "../functions/checkUsername.php",data:{'username':el.value}, async: false }).responseText;
return result;
}
}
}
});
The PHP script checks the username and returns true or false.
If anyone knows what I am doing wrong I will be grateful.