parsley display error message from ajax response

Jacob

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

Jacob

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Parsley custom error message doesn't work

From Dev

custom error display with parsley.js 2.x

From Dev

Ajax get the error or success message from PHP function

From Dev

parsley display error message from ajax response

From Dev

Login display error message

From Dev

Display a separate error message

From Dev

Not Acceptable error showing while calling response from ajax in SPRING

From Dev

display flash and error message after ajax request Laravel

From Dev

Display custom error message from a liferay hook service after an exception

From Dev

Parsley Range validation error message issue

From Dev

How to return error message from ajax post in Node.js

From Dev

ajax how to return an error message from a PHP file

From Dev

ajax response message unique identifier

From Dev

How to get error message from an AJAX call?

From Dev

Ajax get the error or success message from PHP function

From Dev

How to display Parsley error messages before inputs instead of after?

From Dev

Display error message from Admin_Controller to any view

From Dev

Not Acceptable error showing while calling response from ajax in SPRING

From Dev

submit html form with AJAX and display json response from external api

From Dev

Ajax response status 200 but shows error message

From Dev

Display error message when autocomplete is fired if State is not chosen from dropdown

From Dev

Bootstrap - Parsley color display radio button error message after submit

From Dev

Ajax POST - display response

From Dev

How to display the error message

From Dev

Display error message when ajax result return null value

From Dev

Parsley JS - Custom error message %s format

From Dev

Display Image in ajax response in a table

From Dev

React - fetch 'message' from Meta-Data element of the response from an Ajax post request

From Dev

How to show error message from ajax response of api?

Related Related

  1. 1

    Parsley custom error message doesn't work

  2. 2

    custom error display with parsley.js 2.x

  3. 3

    Ajax get the error or success message from PHP function

  4. 4

    parsley display error message from ajax response

  5. 5

    Login display error message

  6. 6

    Display a separate error message

  7. 7

    Not Acceptable error showing while calling response from ajax in SPRING

  8. 8

    display flash and error message after ajax request Laravel

  9. 9

    Display custom error message from a liferay hook service after an exception

  10. 10

    Parsley Range validation error message issue

  11. 11

    How to return error message from ajax post in Node.js

  12. 12

    ajax how to return an error message from a PHP file

  13. 13

    ajax response message unique identifier

  14. 14

    How to get error message from an AJAX call?

  15. 15

    Ajax get the error or success message from PHP function

  16. 16

    How to display Parsley error messages before inputs instead of after?

  17. 17

    Display error message from Admin_Controller to any view

  18. 18

    Not Acceptable error showing while calling response from ajax in SPRING

  19. 19

    submit html form with AJAX and display json response from external api

  20. 20

    Ajax response status 200 but shows error message

  21. 21

    Display error message when autocomplete is fired if State is not chosen from dropdown

  22. 22

    Bootstrap - Parsley color display radio button error message after submit

  23. 23

    Ajax POST - display response

  24. 24

    How to display the error message

  25. 25

    Display error message when ajax result return null value

  26. 26

    Parsley JS - Custom error message %s format

  27. 27

    Display Image in ajax response in a table

  28. 28

    React - fetch 'message' from Meta-Data element of the response from an Ajax post request

  29. 29

    How to show error message from ajax response of api?

HotTag

Archive