Hi, Paul... it definitely helps right now just to now
the procedure is valid.

Now I've just got to figure out the code.

Now... you say that first you set "the field's status to a loading
spinny"...

That's done with this line, right?  :

        $("#"+field+"img.ico").attr("src","/images/office/ico-loading.gif");

Next, this line send your form values via url to your .cfm page?:

        
$.get("/gateway/validate.cfm?field="+field+"&value="+$("#"+field+"input").va
l()+"&criteria="+criteria,

Then, these lines return your response:

                function(response){
                        response = eval("("+response+")");
                        showIcon(field,response.pass,response.msg);

Am I correct so far in my understanding?

Rick


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul
Sent: Monday, March 12, 2007 5:44 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] Calling all CF'ers... et al...

What you described is basically what I do, Rick--not because Jorn's plugin
didn't work but because many of my form fields are validated against each
other, and database interaction is required to make that decision. (e.g.,
the validity of field Y depends on the value already entered in field X.)

Below is the validate function I call onBlur from each input.  It first sets
the field's status icon to a loading spinny, then requests validation from a
CFM file, passing the value of the current field as well as the value of the
dependent criteria, which CF handles (cfswitch/cfcase) depending on which
field is passed.  The callback receives the response and shows either a
success or error icon with a descriptive error attached in a stylish little
error message balloon.

I don't know if this is the smartest method--I'm pretty new to jQuery
myself--but it has worked very well and provides the flexibility I need.

HTH,
Paul

function validateField(field, criteria){
        $("#"+field+"img.ico").attr("src","/images/office/ico-loading.gif");
        
$.get("/gateway/validate.cfm?field="+field+"&value="+$("#"+field+"input").va
l()+"&criteria="+criteria,
                function(response){
                        response = eval("("+response+")");
                        showIcon(field,response.pass,response.msg);
        });     
}





_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to