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

http://bassistance.de


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

Reply via email to