Hello Lee,
On Monday, April 9, 2012 6:14:08 PM UTC-7, Lee Hinde wrote:
I'm trying to edit the field type in a form that is using the html5 doctype. I've tried two ways:
Neither works.
Am I looking in the wrong place?
I use both those techniques and they work great for me. I've use them on many forms for a project I'm working on now. Some examples from my code...
brand_name = forms.CharField ( label = _( 'Brand Name' ), max_length = 128,
widget = forms.TextInput ( attrs = { 'class' : 'span6', 'placeholder' :
'enter brand name', } ) )
...and...
def __init__ ( self, *args, **kwargs ):
super ( AmountPerServing1Form, self ).__init__ ( *args, **kwargs )
for key in self.fields:
field = self.fields [ key ]
field.widget.attrs [ 'class' ] = 'span7'
I don't see anything wrong with your syntax. Have you tried the usual things? Make sure you save the file your're editing, restart the server, etc? And still the form didn't show up with your changes?
Could there be some browser or other caching going on between you and the server?
Are you sub-classing those forms for using them directly?
Toodle-looooooooooooo................
creecode