James, Thanks for the response. yes, I created a single lookup function rather than having to generate mutiple lookups. Shouldn't be a problem if zorn checks the url for ? prior to attaching his key, value pair to the url. if he doesnt check for it, he will after reading this post ands sees the simplicity of a single lookup script.
The documentation fails to include the server side scripts in the examples. but when i looked on my downloaded examples they only return true or false. which is exaclty what my lookup.php returns. ok.... This must be a BUG I just changed my lookup.php to a single line of code: echo "false"; and the validator adds a class of "valid" to my form. Zorn, Please let me know when you get a new version of the validator, I am really looking forward to implementing it in my app but for now I will have to be on my own. On Aug 7, 9:38 pm, James <james.gp....@gmail.com> wrote: > Well, to look at the actual AJAX response, you can use Firebug for > Firefox to see it. > You're suppose to have your remote page return "true" if it's good and > "false" if it's not okay. > > Looking at your code, both username and email validation checks have > the same url and data. Ideally, you're suppose to pass the inputted > username and email data to that URL for your remote script to check > your database again those values, and return "true" or "false". > > On Aug 7, 3:12 pm, Miket3 <miketro...@gmail.com> wrote: > > > I need a way to debug what is being returned when I use the REMOTE > > option. I cant get the validation to give me an error class when a > > duplicate is found. here is my lookup.php which works perfectly fine > > when I use jquery $get to call it. > > > Lookup.php > > <? > > $noheaders = "true"; //prevents config.php from loading any header > > data such a scripts and styles. > > include("config.php"); > > $table = $_GET["table"]; > > $key = $_REQUEST["key"]; > > $value = $_REQUEST["value"]; > > $failmsg = (isset($_GET["failmsg"]) ? $_GET["failmsg"] : $value.": Not > > Found in TABLE: ".$table." for KEY: ".$key); > > $foundmsg = (isset($_GET["foundmsg"]) ? $_GET["foundmsg"] : $value.": > > Found in TABLE: ".$table." for KEY: ".$key); > > $sql="SELECT * FROM $table WHERE $key='$value'" ; > > $result=mysql_query($sql); > > if (mysql_num_rows($result) > 0) { > > echo $foundmsg;} else {echo $failmsg; }; > > > ?> > > > Here are my rules: > > var validator = $("#myform").validate({ > > rules: { > > username: { > > required: true, > > minlength: 4, > > type: "GET", > > remote: > > "lookup.php?table=members&failmsg=true&foundmsg=false" > > }, > > password: { > > required: true, > > minlength: 5 > > }, > > email: { > > required: true, > > email: true, > > type: "GET", > > remote: > > "lookup.php?table=members&failmsg=true&foundmsg=false" > > } > > }, > > messages: { > > > Thanks, > > Mike