As Massimo suggested, you should use Javascript to disable the Type input
when the boolean remains unchecked (and reset Type if an option was
selected and the boolean subsequently unchecked). But if you also want to
validate on the server (which isn't a bad idea), you might try
IS_LENGTH(0), or possibly IS_EQUAL_TO, IS_MATCH, or IS_EXPR.
Anthony
On Sunday, June 2, 2013 9:01:45 AM UTC-4, BlueShadow wrote:
>
> I got a database field which needs to be filled when a bolean is true and
> when its not true it should be empty.
> Thats what I did:
> Field('Booleancheck','boolean'),
> Field('Type','reference Type_table', requires=IS_IN_DB (db,'type_table.id'
> ,'type_table.Name') if request.vars.Booleancheck else None),
>
> This requires the field to be filled if booleancheck is true but when its
> falls it can be filled. is there a IS_EMPTY() validator?
>
--
---
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.