> Can  you tell me what combination of IDs and names caused the "confusion"?

        What was happening is this:

        I had a form with an id of #Mortgage_Calculation_Form.

        I had inputs for the form named Principal, Interest, and Years.
        However, these inputs did not have any id assigned to them.

        When the plug-in ran, it created id's for them:

        For Principal, the id became #Mortgage_Calculation_FormPrincipal.
        For Interest, the id became #Mortgage_Calculation_FormInterest.
        For Years, the id became #Mortgage_Calculation_FormYears.

        It combined the form id with the name of the inputs to form the
id... at least
        that's what I gathered from looking at the response that Firebug
returned.

> All formatting should be done via external stylesheets. The plugin lets 
> you customize the class used to mark them as "error labels", but that's
it.

        What is the "class used to mark them as 'error labels'"?
        Is that a class that I assign to them for the stylesheets to
reference?

Rick





-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Jörn Zaefferer
Sent: Thursday, March 08, 2007 5:23 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Need some guidance...

Rick Faircloth schrieb:
> Well, Jorn... I finally figured out the problem...
>
> I hadn't assigned an id's to my form fields (Principal, Interest, Years),
> so I couldn't see the conflict.
>
> However, it looks like id's were automatically being assigned to my
> form fields when published... they were renamed using the form id
> and then the field name attached, as in
> "#Mortgage_Calculation_FormPrincipal"
> and I guess this id was confusing the validation plug-in (although I'm not
> quite sure why because even though the automatically generated id name
> included the form id name, it was not the same name exactly.
>   
The plugin genereates IDs by combining the form's id with the element's 
name. Of course that doesn't happen when element already have IDs. Can 
you tell me what combination of IDs and names caused the "confusion"? 
I'd like to fix that.
> However, the lesson learned:  Always assign id's (unique ones) to every
> element.
>
> So I've got the plug-in working.
>
> Now I've got two more questions:
>
> 1)  How do I format the validation message?  In the plug-in settings?  Can
I
> put CSS formatting in there?
>   
All formatting should be done via external stylesheets. The plugin lets 
you customize the class used to mark them as "error labels", but thats it.
> 2) How can I get the messages to display above the form fields? Can the
> label tag take CSS formatting in-line?
>   
You can use the errorPlacement option to take the placement of the 
labels in your own hand. So you could append them to the body element 
and add absolute positioning.

Beware that the example of the errorPlacement option is flawed. The 
second argument is not the ID, but the element itself as a jQuery 
object. The documentation for the option itself is correct.

-- 
Jörn Zaefferer





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

Reply via email to