py4web - name of form - add classes to form

30 views
Skip to first unread message

Jim S

unread,
Jan 21, 2020, 4:12:28 PM1/21/20
to web2py-users
I'm using Form from:

from py4web.utils.form import Form

I want to add some classes to the <form> tag that is generated.  In web2py I can add _class='field is-horizontal' when creating the instance and the classes will be passed along.

Optionally I could add some css/javascript that could modify the classes.  However, then I need to be able to reference the form.  I assumed I could do that with the form_name argument, but that doesn't add a name or id to the form element.  It is used on some of the children, but not on the form itself.

How can I add classes to the form and to the elements inside the form?

-Jim
Reply all
Reply to author
Forward
0 new messages