I think John is brilliant - a bona fide genius.  In fact, he's me!  In
another forum I participate in there are 2 other John Wilsons, so I started
using Daemach instead.  Now it's habit.

I do think taconite is a great bridge for beginning coders - it has all the
power of jQuery because it's calling jQuery functions directly.  If you're
having trouble with the javascript coding it's worth your time to get your
head around it.  It is slightly less flexible than pure js/jQuery, but not
much.

The form was just to illustrate the mechanics.  You are free to make the
form work however you want.  I've just been trying to help you learn by
helping you solve the problems as you presented them.  Just look at how it
works now by using the firebug console, read the taconite and jQuery docs
thoroughly and start experimenting.  Teach a man to fish and all that ;)

If it were me I wouldn't go this route - I would do all the validation on
the client side or just use a masking function to ensure that they
*couldn't* type anything but numbers.  For example, the below code solves
your validation problem where calculators are concerned:

               $("input:text").each(function(){
                         $(this).attr("title",this.value).keyup(function(){

                               if (isNaN(this.value)) this.value =
this.title;
                               else this.title = this.value;
                         })
                 });

If you wanted to stick with using the validation, I would also use keyup
events to validate instead of blur because blur requires you to tab out of
the field to do the validation.  My autoSave plugin handles most of that for
you, including minimizing the number of ajax calls by adding a timer event
to the input fields.

                $("input:text").autoSave(function(){
                               var Params = {};
                               $("input:text").each(function(){
                                       Params[$(this).attr("name")] =
$(this).val();
                               });
                               $.post("CalcTest.cfm",Params);
                });

If you wanted to use a button to calculate, the natural thing would be to
disable the button until validation passed.  This means that when using the
blur event, when you tab out of that last field the button would still be
disabled which feels strange.  Rather than using messages for validation you
might also consider using other cues, like adding a colored border or
background to the fields - red for a bad value and green for good.

And I took the calculation directly from your first post ;)

On 3/17/07, Rick Faircloth <[EMAIL PROTECTED]> wrote:

 Hi, Daemach…



Actually, the line below to the calctest.cfm works somewhat,

but it doesn't function as I want it to… no button to click for

calculation... I prefer that the user have to click a button.



Calculations are incorrect.



But I really haven't had time to thoroughly evaluate the approach.

This is something very different from every other approach I've been

working on… this was done by John Wilson using Taconite.  He

just put something together for a basic proof-of-concept for me.



I've got to take some time to study his approach and the Taconite

plug-in.  Have you used the plug-in?  John's recommending it as

a tag-based bridge for those of used to CF's syntax and trying to

learn jQuery.  What's your take on that?



Rick



*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *Daemach
*Sent:* Friday, March 16, 2007 2:34 PM
*To:* jQuery Discussion.
*Subject:* Re: [jQuery] Can't figure out how to put this all together...



Looks like it works - is it making more sense now?

On 3/16/07, *Rick Faircloth* <[EMAIL PROTECTED] > wrote:

Oh, and I meant to give you the online demo…



http://bodaford.whitestonemedia.com/html/calctest.cfm



Rick



*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On
Behalf Of *John Wilson
*Sent:* Friday, March 16, 2007 12:48 AM
*To:* [email protected]
*Subject:* Re: [jQuery] Can't figure out how to put this all together...



A while back, I mentioned to Rey that I thought Mike Alsup's taconite
plugin was a nearly perfect bridge for CF programmers learning ajax.  It's
time to see if I was right ;)


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to