Two broad suggestions: First, get familiar with Firebug; in addition to just
js errors its messages will alert you to 404 errors (which you would have
caused by calling a file in the wrong folder) as well as 500 errors (which
are the result of CF errors) and save you a lot of time wondering why ajax
isn't working.  Second, poke through the tutorials on jquery.com, which
explain the basics and will turn you on to the possibilities.  

Now back to your question, assuming you're like me and develop in
iterations, I would simply start by copy/pasting the .blur() binding for
each field:

$("#Some-Field-ID").blur(function(){ //assign a blur event to the input
$.post("callpage_Validate_Mortgage_Inputs.cfm",
{some-variable-name:$("#Some-Field-ID ").val()}, function(data){

When I start by taking the easy way out like this, I typically begin to see
how it works and realize along the way how to make it more tidy.

You'll also need to handle the POST variables that will be different on the
CF side; assuming it existed in v 4.5, CF's structKeyExists(form,
"some-variable-name") function would do the trick.

And of course, the usual disclaimer: there are better ways to accomplish
this task (Jorn's plugin being one of them), but this will get you started.

-pm

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Rick Faircloth
Sent: Tuesday, March 13, 2007 7:38 PM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] Ok... one last effort to make this work... help!

Yay!  It works!  Thanks, Paul!

Now that that's over... besides the code that your repaired in the
javascript, I found I had another issue that didn't show up until
after the code was repaired... I had the page I was calling
*IN THE WRONG FOLDER*!!!!!!   AAAAARRRRRRGGGG!

How stupid...

Anyway... no I need to figure out how to modify the code
to get it to work for each form field.  There's a total of three
in this small Mortgage Calculation form.

You mentioned "abstracting" the code for more inputs... I assume
that would mean modifying these two lines of the javascript, right?

$("#Principal").blur(function(){ //assign a blur event to the input
$.post("callpage_Validate_Mortgage_Inputs.cfm",
{principal:$("#Principal").val()}, function(data){

I really don't have any idea how to code that.  Would you care to offer
a little more assistance on that?  I would try first...I'm really not trying
to impose...
but I don't have a clue where to start.

I would have never figured out the syntax that you used in the javascript.
I guess that's probably the hardest of learning to use any language.

I had actually gotten validation with Jorn's plug-in to work well, but ran
into
limitations, and I figured I'd be better off trying to validate with a
language
I know better... CF.

Thanks so much for your help!

Rick



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

Reply via email to