Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing JQuery Validation Plugin Remote Function - Help checking if email exists
    primarykey
    data
    text
    <p>Im trying to use the remote feature in the JQuery Validation Plugin to check to see if the email address exists. I cannot get it to return the status of it being registered. I am using the default php class provided. I am using Jquery Latest</p> <p>Here is my class</p> <pre><code>&lt;script type="text/javascript"&gt; $.validator.setDefaults({ submitHandler: function() { alert("submitted!"); }}); $().ready(function() { // validate signup form on keyup and submit $("#form1").validate({ rules: { user_pass: { required: true, minlength: 6 }, user_pass_confirm: { required: true, minlength: 6, equalTo: "#user_pass" }, email: { required: true, email: true, remote: { url:"module/1.func.php", type : "get", data : { email : function() { return $("#email").val(); }, } } }, terms: "required" }, messages: { user_pass: { required: "Please provide a password", minlength: "Password must be at least 6 characters" }, user_pass_confirm: { required: "Please provide a password", minlength: "Password must be at least 6 characters", equalTo: "Eenter the same password as above" }, email: { required: "Enter your email address", email: "Enter a valid email address", }, terms: "Please accept our policies" } }); }); </code></pre> <p></p> <p>-----EDIT--ADDED 1.inc.php----- <pre><code>$email = $_REQUEST['email']; if($email=="me@god.com"){ $valid = 'false'; }else{ $valid = 'true'; } echo $valid; ?&gt; </code></pre> <p>-----EDIT--Changed Jquery-----</p> <p>I have now changed the email rule to the following. I get "Please Fix this field" when the email is inputted if it matches.</p> <blockquote> <p>email: { required: true, email: true, remote: "module/1.func.php" },</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload