is it possible to validate form based on value on another form field?
*e.g.*
*controllers/default.py*
def test():
* if request.vars.field0 == 4:*
* #if request.post_vars.field0 == 4:*
* db.test.field1.requires = IS_IN_DB(db, db.field1.id, db.field1._format)*
* else:*
* db.test.field1.requires = IS_EMPTY_OR(IS_IN_DB(db, db.field1.id, 
db.field1._format) )*

* db.test.field1.show_if = (request.post_vars.field0 == 4)*

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)

already test with code above but the result is not expected, no error 
occured but the result is not expected. is there any way to accomplish 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