0

I am looking at this resource here:

http://jqueryvalidation.org/remote-method#options

In their example code:

$( "#myform" ).validate({
rules: {
email: {
required: true,
email: true,
remote: "check-email.php"
}
}
});

What do I need to pass back or echo back within check-email.php?

Also, will this work with post forms?

sunshinekitty
  • 2,307
  • 6
  • 19
  • 31

1 Answers1

0

Unfortunately this didn't come up in related until after I posted it: jQuery Remote validation

Using the code

echo json_encode($variable);

Passing a boolean this way gives JQuery the information on whether or not it was deciphered correctly, one thing to note that in the referenced link the user is using strings instead of booleans, which will not work properly.

Community
  • 1
  • 1
sunshinekitty
  • 2,307
  • 6
  • 19
  • 31