The password widget is actually an INPUT helper wrapped in a CAT helper 
(which enables the new entropy validator Javascript to be appended if 
needed), so form.custom.widget.password actually refers to the outer CAT 
helper and form.custom.widget.password['_class'] is therefore the class of 
the CAT, not the inner INPUT (and CAT doesn't result in any HTML tags being 
rendered, so its "_class" attribute is simply ignored). Instead, you can do:

form.custom.widget.password[0]['_class'] = 'string input-medium'

The [0] subscript selects the INPUT element inside the CAT element.

Wrapping the password widget in CAT is a recent change and has been causing 
some confusion, so we should probably document it better.

Anthony

On Monday, January 14, 2013 12:22:41 AM UTC-5, Aris Green wrote:
>
> Why does this code not work?
>
> {{=form.custom.begin}}
>
>    # some junk here, next line does not work
>
> {{
> form.custom.widget.password['_class'] = 'string input-medium'
> }}
>
> I want to override the default password input widget CSS class in the 
> view, and it refuses to be overridden.  I need flexibility when styling the 
> form.  This does work for the other auth fields such as email, first_name, 
> etc.
>
> Thanks
> Aris Green
>

-- 



Reply via email to