Hi Eric, You can just use JS. And load the data through ajax too (if there is a lot). Search for "cascading" or cascading drop down lists on this group and on web2pyslices.com to get yourself started.
On Monday, December 17, 2012 11:48:00 PM UTC, Eric Seidler wrote: > > Hi. > > I have a grid object that I'm using to update records. > I'd like to be able to limit the input value of field B based on the fixed > value of field A when the update button is clicked for that record. > > > For example: > > step, outcome > 1, A > 1, B > 1, C > 2, C > 2, D > 3, A > 3, D > ... > > So if step==1 for a record, the 'outcome' dropdown on the edit page should > display 'A','B', and 'C' when > the update button is clicked for that record. Similarly, 'C' and 'D' > should be displayed if step==2. > Note that the value for the 'step' field is constant for that record, it > is not a field that can be updated, so it's not a dropdown. > > > I've been trying to use the "requires" method on field B, but I can't > figure out how to send the value of field A > _for a specific record_ to that method. I've seen > "request.vars.<fieldname>" but that seems to > work only after the form is submitted and I'd like to see the options for > field B _before_ the field is > submitted. > > Can I handle this using only web2py or do I need some javascript? > --