I need to validate a phone number through remote method from validation, but also the response i get is not true/false and the form doesn't validate. It is possible to alter the reponse after i use the parameter which is returned?
remote: {
url: "index.php/main/verifyphone",
type: "post",
data: {
phone: function() {
return $("#PHONE").val();
},
product: function() {
return $("#choose").chosen().val();
}
},
complete: function(response) {
if (response.responseJSON!=false) {
$("#GUID").attr('value', response.responseJSON);
return true;
} else {
return false;
}
}
}
In this form, the response is treated as a custom message for failure. I need to transform the response to TRUE, after i save the responseJSON, so my form can validate. Any ideas? PS: The response from php can be false or an number. If it is a number, validate the form.