Question

I'm working on a project where I have dependent fieldsets and dropdowns, and I'm wondering if backbone.js is a good way to go about this.

The setup is like this: -fieldset A with dropdown A1 -fieldset B with dropdowns B1 and B2

Fieldset A and dropdown A1 should always be visible. On making a selection in dropdown A1, fieldset B and dropdown B1 should appear. On making a selection in dropdown B1, dropdown B2 should appear.

Changing dropdown A1 should "reset" fieldset B and dropdown B1, and dropdown B2 should disappear.

Though this example is limited to describing two fieldsets with dropdowns, there may be more, all dependent on selections made further "up the chain."

Is backbone.js a good solution for this problem? If so, what's the best way to approach this setup?

Was it helpful?

Solution

I'd strongly recommend checking out backbone-forms, which you can use to create conditional fields (among many other things).

See my explanation in this answer: backbone-forms with conditional fields

I also created a live demo here: backbone-forms with conditional fields which is based on this discussion in the backbone forms google group.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top