If the dropdown for field2 depends on the value of field1, then you cannot specify the contents of the field2 dropdown on the server at the time the form is first created. Instead, you'll have to fill in the field2 dropdown via Ajax after a selection is made in field1. web2py does not include any built-in functionality for this, but there are some options: http://stackoverflow.com/questions/8146260/best-practice-for-populating-dropdown-based-on-other-dropdown-selection-in-web2p/8152910#8152910 .
Anthony On Monday, June 17, 2013 12:48:05 PM UTC-4, webpypy wrote: > > Thank you, everybody. > > let me describe what i am trying to do. > > a table has field1 , field2 > > field1 is referenced in reftable1 > field2 is referenced in reftable2 > > reftable2 has a field (reftable1_id) that is referenced in reftable1. > > field1 is entered through dropdown list by > db.table.field1.requires = IS_IN_DB(db(db.reftable1.id>0),'reftable1.id' > , '%(name)s') > > > My question is about entering field2, the dropdown list needs to be > according to the value entered in field1. > db.table.field2.requires = IS_IN_DB(db(db.reftable2.reftable1_id == > request.vars.field1),'reftable2.id','%(name)s') > > is not working. > > > why? > or how to debug? > > Regards, > > ashraf > > -- --- 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/groups/opt_out.