how to give forms a class

18 views
Skip to first unread message

sasogeek

unread,
Jan 11, 2013, 6:36:31 PM1/11/13
to web...@googlegroups.com
if i have this in normal html coding...

<form class="form-1">
    ...
</form>

how do I make the same effect if i have
#controller
...
form = auth()

#view
...
{{form.custom.begin}}
...
{{form.custom.end}}


I know that to give a form descendant element, like input for example, a class, you can do

form = auth()
email = form.element('input', _name='email')
email['_class'] = 'field'

but what about the form element itself?

Bruno Rocha

unread,
Jan 11, 2013, 6:41:42 PM1/11/13
to web...@googlegroups.com
form['_class'] = 'foo'

it should work

or even

form.elements('form')[0]['_class'] = 'foo'
Reply all
Reply to author
Forward
0 new messages