2009/8/10 Filip Gruszczyński <[email protected]>:
>
> Hi everyone!
>
> Putting asterisks after a required field is a common practice. To
> achieve I use right now a filter that is invoked after every form
> field in a template. This isn't very convenient, but I haven't found
> any better solution yet.
>
> I wonder if something like this couldn't be added to Django? Mayber
> such option could be added to a form, so it would know how to render
> all fields and when any of them is required, add an asterisk after it.
> Or maybe - I don't yet know, if it's possible - during rendering it
> could inform widgets to add asterisks.
>
> If that's reasonable and possible to be done, I'd gladly try to this.

This is what CSS is for. If you look at the rendered HTML for the
label on a required field, it already has a 'required' class - for
example:

<label for="id_title" class="required">Title:</label>

By default, the admin makes required fields bold; if you want to apply
a trailing asterisk, you should be able to use the 'content' CSS rule
to achieve this.

Yours,
Russ Magee %-)

--~--~---------~--~----~------------~-------~--~----~
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