Hi Nathan -- yes I studied it pretty carefully. Can't say I understand
the whole thing, but I think it's more complicated than I need,
frankly. I've been trying to figure out whether I can do this with a
mixture of jQuery and a custom widget. Right now, I'm thinking the
jQuery is all I really need.

On Jul 10, 2:36 pm, "mr.freeze" <[email protected]> wrote:
> Have you seen this?:http://www.web2pyslices.com/main/slices/take_slice/85
>
> On Jul 10, 1:12 pm, weheh <[email protected]> wrote:
>
> > This is an old issue that I'm finally getting back to. I've researched
> > this forum heavily for indications about how to do this and have
> > concluded that perhaps there is some new functionality in web2py that
> > will accomplish this for me automatically.
>
> > The issue is I want a form with two drop downs where the value of the
> > 2nd drop down is contingent on the value of the first.
>
> > #models
> > db.define_table('animal',Field('name'))
> > db.define_table('pet',Field('name'),Field('animal',db.animal,requires=IS_IN_DB(db,'animal.id','%
> > (name)s'))
>
> > # animal is preloaded with 2 types: "dog" and "cat"
> > # pet is preloaded with a few pets:
> > #  rex, dog
> > #  bowser, dog
> > #  luna, cat
> > #  felix, cat
>
> > #controller
> > form=SQLFORM.factory(db.animal,db.pet)
> > ...
>
> > When the form is displayed, I want it so that when the animal type is
> > set to dog, the pet names will only display "rex" and "bowser". If the
> > user selects the animal type to "cat", then the pet list dynamically
> > changes to "luna" and "felix".
>
> > What is the latest and greatest way to accomplish this? Should I be
> > going to jQuery (my default choice)?

Reply via email to