Thanks, Sam!

That will be much more flexible than my approach.
I've often found that when I first begin to learn coding
techniques, that I end up learning the "long-hand" version
first and getting that working, then it's easier to see ways
to move to "short-hand".

I'm learning CSS the same way.  I use it inline a lot now,
but sooner or later, I'll begin to see how creating classes, etc,
will make everything more flexible and end up writing much less code.

Do you have any idea how I might solve the problem mentioned
below about disabling the submit button while entry errors exist
and enabling the button when all field entries are satisfactory?

I can't get a handle on that one.

Rick

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Sam Collett
Sent: Saturday, March 10, 2007 2:52 AM
To: jQuery Discussion.
Subject: Re: [jQuery] Validation help with Date Selector

On 09/03/07, Rick Faircloth <[EMAIL PROTECTED]> wrote:
> Well.. thanks to everyone's help, especially yours, David,
> I've finally got a perfectly working solution that is based on
> your solution, David.  Thanks to Jorn and Sam, too!
>
> (Just a note:  I've still got one problem to solve.  When a form field has
> been left empty and the error message appears, a user can still click
> the "Calculate" button and submit the form, which causes a ColdFusion
> error due to the lack of the data to make the payment calculation.  How
> can I render the button "invalid" or unclickable if there's an error
> showing?)
>
> You can see the finished work at http://bodaford.whitestonemedia.com
> Click on a photo on the home page to go to the Featured Properties page.
> Scroll down until you see the "Click here to Calculate Mortgage." line.
> Then you should see the form.
>
> Here's the way I had to modify the code for the plug-in:
>
> errorPlacement: function(error, element) {
>
>         if(element.attr('id') == "Principal") {
>            error.appendTo("#principal_error");
>                 }
>
>         else
>
>         if(element.attr('id') == "Interest") {
>            error.appendTo("#interest_error");
>         }
>
>         else
>
>         if(element.attr('id') == "Years") {
>            error.appendTo("#years_error");
>         }
>     },

A more generic way:

errorPlacement: function(error, element) {

          error.appendTo("#" + element.attr('id') + "_error");
   },


Slight change in HTML:

<td></td><td id="Principal_error"></td>

Doing it this way will mean you don't have to edit your JavaScript for
the error placement if more fields are added.

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



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

Reply via email to