yep.

BTW: this just hides the field. if someone fills the "bb" field, it gets 
sent with the form anyway.

On Tuesday, June 4, 2013 10:55:31 PM UTC+2, Ramos wrote:
>
> Show if =visible when 
> No dia 04/06/2013 21:51, "Niphlod" <[email protected] <javascript:>> 
> escreveu:
>
>> it works, but a few hiccups with the examples posted....
>>
>> def index1():
>>     """ shows bb only if aa is checked """
>>     db.define_table('thing', Field('aa','boolean'),Field('bb'))
>>     db.thing.bb.show_if = db.thing.aa==True
>>     form = SQLFORM(db.thing)
>>     return locals()
>>
>> def index2():
>>     """ shows bb only when aa is not set to "x" """
>>     db.define_table('thing', Field('aa'),Field('bb'))
>>     
>> db.thing.aa.requires=IS_IN_SET(('x','y','z'))                              
>>     db.thing.bb.show_if = 
>> db.thing.aa!='x'                                     
>>     form = SQLFORM(db.thing)
>>     return locals()
>>
>> def index3():
>>     """ shows bb only when one types "x" or "y" in aa"""
>>     db.define_table('thing', Field('aa'),Field('bb'))
>>     db.thing.bb.show_if = db.thing.aa.belongs(('x','y'))
>>     form = SQLFORM(db.thing)
>>     return locals()
>>
>> def index4():
>>     """ shows bb only when one types "abcd" in aa"""
>>     db.define_table('thing', Field('aa'),Field('bb'))
>>     db.thing.bb.show_if = db.thing.aa.contains('abcd')
>>     form = SQLFORM(db.thing)
>>     return locals()
>>
>>  -- 
>>  
>> --- 
>> 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] <javascript:>.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>

-- 

--- 
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.


Reply via email to