Re: How to apply a class to a specific field's label in newforms

2008-01-22 Thread Kenneth Gonsalves
On 22-Jan-08, at 6:35 PM, shabda wrote: > My template is > > {% for field in form %} > > {{ field.label_tag }} > {{field}} > {% if field.help_text > %}{{ field.help_text }}{% endif %} > {% if field.errors %} class="myerrors">{{ field.errors }}{% endif %}

Re: How to apply a class to a specific field's label in newforms

2008-01-22 Thread shabda
My template is {% for field in form %} {{ field.label_tag }} {{field}} {% if field.help_text %}{{ field.help_text }}{% endif %} {% if field.errors %}{{ field.errors }}{% endif %} {% endfor %} How can I check the name of the current field? On Jan

Re: How to apply a class to a specific field's label in newforms

2008-01-22 Thread Kenneth Gonsalves
On 22-Jan-08, at 5:45 PM, shabda wrote: > I want to have the one of the field for my form have a specific css > class. But if I do something like, > widget = forms.TextInput(attrs = {'size':60, 'class':'main'} > The textInput, and not its associated label gets the class. How can I > specify the

How to apply a class to a specific field's label in newforms

2008-01-22 Thread shabda
I want to have the one of the field for my form have a specific css class. But if I do something like, widget = forms.TextInput(attrs = {'size':60, 'class':'main'} The textInput, and not its associated label gets the class. How can I specify the class for label? --~--~-~--~~---