On Feb 16, 1:07 pm, "waylan" <[EMAIL PROTECTED]> wrote:
> On Feb 16, 3:28 pm, "jfagnani" <[EMAIL PROTECTED]> wrote:
>
> > (I think I lost an earlier reply, so hopefully this isn't a dupe)
>
> > I think it's important to add the classes to the fields themselves, as
> > well as the <tr>, <li>, and <p> elements.
>
> IMHO that addes no additional value. If you want the styling to apply
> to the field itself, just do for example:
>
>     .error input {border:solid 1px red;}

How does that work if you don't have inputs enclosed in <tr>, <li>, or
<p> elements? The way I typically use form fields is by placing them
in the template with {{ form.field }}, not with the as_() methods, so
there won't be any .error elements to match against. It would be
annoying and repetitive to have to wrap every field with code to
highlight it in the template.

> I haven't used newforms this way yet (I've only used as_methods), so I
> assumed that was already possable from the template.

Jame's reply indicates that this is already possible, so I'll check it
out. I looked at the code and didn't notice anything in the field or
form classes that did this.

-Justin


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to