yes, thanks for the hints lionel, the show_if works, but the requires part 
that depend on another form field is still not work.
no error occured, but the form validation is not work.
i've create another simple webapp too but still got the same (before use 
is_in_db() that refer to another table, the new webapp is simpler just use 
is_in_set() )
*e.g. *
*models/db.py*
db.define_table('test', 
Field('field0', requires = IS_IN_SET([1, 2] ) ),
Field('field1'),
format = '%(field0)s')

*controllers/default.py*
def test():
* if request.vars.field0 == 1:*
* #if request.post_vars.field0 == 1:*
* #if db.test.field0 == 1:*
* db.test.field1.requires = IS_NOT_EMPTY()*

fields = ['field0', 'field1']
form = SQLFORM(db.test, fields = fields)
if form.validate():
db.test.insert(**db.test._filter_fields(form.vars) )
return dict(form = form)

what i expected, when user select the 1, the field2 will give a 
form.field2.error indicate that the field2 must be filled
the above code not give an error, it just input to the table, wheter the 
choice is 1 or 2.
is there any way to fix this using web2py way?

thanks and best regards,
stifan

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to