Thanks Jose, that was too easy!

Jim

From:  Jose <jjac...@gmail.com>
Reply-To:  <web2py@googlegroups.com>
Date:  Wednesday, December 19, 2012 4:26 AM
To:  <web2py@googlegroups.com>
Subject:  [web2py] Re: how to hide a field until another field is chosen
using SQLFORM.smartgrid



El martes, 11 de diciembre de 2012 21:50:07 UTC-3, JimK  escribió:
> I have a table defined with many columns but some are only relevant if a
> previous one is chosen.  How would I hide a field like this with
> SQLFORM.smartgrid?
> 
> model:
> db.define_table('t_schedule_frat_query',
> Field('f_recurring', type='boolean', notnull=True,
>   label=T('Recurring schedule?'),
> Field('f_schedule_frequency', type='string',
>   label=T('Schedule Frequency'),
> auth.signature,
> format='%(f_query_name)s',
> migrate=True)
> 
> controller:
> def foo():
>     form = SQLFORM.smartgrid(db.t_frat_query)
>     return locals()
> 
> view:
> default view
> 
> On the webpage, t_schedule_frat_query. f_schedule_frequency should only show
> up if t_schedule_frat_query. f_recurring is checked.  How would I do this?
> 
> 
> Jim

Hi Jim

maybe this [1] will help

Jose

[1] 
http://www.web2py.com/books/default/chapter/29/11#Conditional-fields-in-form
s 
-- 
 
 
 


-- 



Reply via email to