I am using the jquery validation and i need to validate an email.
I use
$(\"#myForm\").validate({
rules:
email: {
first of all i want to tell you that if you are using post method in ajax then dont pass email in url.
$.ajax({
type: "POST",
url: URLROOT + '/register/check/';
data: {email:email};
success: function (result) {
if (result == 'exist') {
return false;
} else {
return true;
}
}
});`
after that you remove parameter from controller's function.
`public function check(l) {
if($this->userModel->findUserByEmail($_POST['email'])==true)) {
return 'exist';
}
return 'false';
}`
Try with this.