What are you trying to achieve? Do you want fields to be shown/hidden
dynamically in the browser based on the values of other fields? If so, see
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Conditional-fields
or use custom Javascript.
If you want to hide a given field when creating the initial HTML rendering
of the form, then you can use something like your approach, though you
would add a special CSS class:
form.element("#id_element").add_class('hidden')
Anthony
On Thursday, August 27, 2015 at 10:40:08 PM UTC-4, José Eloy wrote:
>
> Hi!
>
> Is it possible to use form.element to show/hide form elements?
>
> I'd like to use:
> form.element("#id_element")['_show'] = True
> to show an element
> or
> form.element("#id_element")['_show'] = False
> to hide an element
>
> Thanks.
>
--
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.