On Saturday, February 17, 2018 at 10:57:08 AM UTC-5, F.C. wrote:
>
> How do i change the class of a custom and/or standard form button. Is
> there an example you can reference? Again, thank you for the assistance
>
To add a class to the submit button:
form.custom.submit.add_class('my_class')
To completely change the class:
form.custom.submit['_class'] = 'my_class'
You can also use .element() (as described here
<http://web2py.com/books/default/chapter/29/05/the-views#elements>) to find
and manipulate any DOM element within the form.
Finally, SQLFORM takes a "formstyle" argument, which can be a function that
produces the form DOM. For examples of how the function should work, see
for
example:
https://github.com/web2py/web2py/blob/82cf2eb44db907a3ca20c29ee8116f95ef77bb5a/gluon/sqlhtml.py#L991.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.