On Tuesday, October 29, 2013 10:12:37 AM UTC-4, [email protected] wrote:
> What I ended up doing was just that; I wrote out what form.custom.begin
> was outputting and added the style tag manually. I was just wondering if
> there was a way to manipulate the tag without resorting to this.
>
It depends on how the form is created. If you create it directly, you can
just do:
form = SQLFORM(..., _style='...')
If it's an Auth form, you can't do that, but if you don't specifically need
to use the form.custom items to create a custom layout, you can do:
form = auth.login()
form['_style'] = ...
If it's an Auth form and you need to use form.custom.begin, then the best
option is probably what you have done. Anway, doing:
<form action="#" enctype="multipart/form-data" method="post" style="...">
isn't much more difficult than doing:
{{form.custom.begin['_style'] = '...'}}
{{=form.custom.begin}}
I suppose another option would be:
{{=str(form.custom.begin).replace('>', ' style="...">')}}
Though just typing out the raw HTML is just as easy and probably more
straightforward.
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/groups/opt_out.