Well each field has and id that in your case here appears as 'id_age'.
 So you can attach a style sheet item to that field directly but that
will not do anything for the whole row.

If you just wanted to add something to the label like 'Age *" so the
user can see that it's required that way, then use the label_suffix
option when creating the form.

If you want to customize the output of the form, you either have to
write out the contents yourself
(http://www.djangoproject.com/documentation/newforms/#complex-template-output),
or create your own as_??? construct that give you what you want.

Michael Trier
blog.michaeltrier.com

On Dec 7, 2007 5:27 AM, Frank 7200 <[EMAIL PROTECTED]> wrote:
> Hi group,
> another question. Is there a way how to pass an information to markup that a
> form field is required?
>
> I have this form with one field, which is required (default value).
>
> class CustomForm(forms.Form ):
>      age = forms.ChoiceField(label='Age', choices=AGE_CHOICES)
>
> <table>
> {{ form.as_table}}
> </table>
>
> This is what appears in the markup
> <
> tr><th><label for="id_age">Age:</
> label></th><td><select name="age"
> id="id_age">
> <option value=
> "1" selected="selected">0-3</option>
>
> I would need something like <tr class="form-required"> because I would like
> to highlite the whole table row. Or at least <select class="form-required">
>
> How can I do that?
>
> Thanks for any advice,
> Frank
>
>  >
>

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

Reply via email to