>
> def get_form_fields(form):
> formfields = dict()
> for c in form.elements('input, select, textarea'):
> name = c.attributes['_id']
> formfields['c_' + name] = c
> for l in form.elements('label'):
> name = l.attributes['_for']
> formfields['l_' + name] = l
> return dict(form=form,**formfields)
>
>
Note, you don't need that function, as the widgets and labels (and
comments) are in form.custom.widget.[fieldname],
form.custom.label.[fieldname], and form.custom.comment.[fieldname]. You can
also create custom HTML via a custom formstyle function.
See
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Custom-forms.
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.