I'm using parsley validation to check if the user email already exist in the database ,
<input type="email" data-parsley-trigger="change" data-parsley-remote-options='{ "type": "POST", "dataType": "jsonp" }' data-parsley-remote="check.php" name="Email" id="Email"/>
and for the the ajax check.php
$email=$_POST['Email'];
$sql="select * from user where email ='".$email."'";
$mail=User::find_by_sql($sql);
if($mail) { echo("{\"error\": \"Username exists\" }"); else echo("{\"error\": \"Username available\" }");
I can not get the error or success message to display in the form .... please help ,,, thank you in advance
I solved the problem by adding data-parsley-remote-message in the form input and in the check.php I added "echo json_encode" to return true or false based on the condition
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments