Rick, I'll see if I can make time for this tonight...  It's 65 outside and
my road bike beckons seductively from the garage.  Unfortunately my desire
to help is overwhelmed by the end of a long, cold winter in the mountains...

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

Paul, could I impose upon you to strip your example code
down to handling one field?  I don't understand everything you've
got there, and what it all refers to.

Also, could you send an example of your cf processing for a field?

This would give me enough to work on and test.  Hopefully I can figure
it out from there.

Thanks for all your help!

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").val()+"&criteria="+criteria,
                function(response){
                        response = eval("("+response+")");
                        showIcon(field,response.pass,response.msg);
        });     
}





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


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

Reply via email to