How do i specify the class of a custom web2py form? for e.g.
{{=form.custom.begin}}
Image name: <div>{{=form.custom.widget.name}}</div>
Image file: <div>{{=form.custom.widget.file}}</div>
Click here to upload: {{=form.custom.submit}}
{{=form.custom.end}}
How do i specify the CSS class for form ?
If it's a SQLFORM, you can specify the class when you create the form:
form = SQLFORM(db.mytable, _class='myclass')
Otherwise, form.custom.begin simply produces the following HTML:
<form action="" enctype="multipart/form-data" method="post">
so instead of using form.custom.begin, you could simply enter that HTML (with your class added) directly into the template.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With