Backbone Forms Update Select Box Values

647 Views Asked by At

( i am using the backbone forms extension to create my forms: https://github.com/powmedia/backbone-forms)

I have two select boxes and when the first is changed it should change the values of the second. I have got the filtering sorted and have an array of objects that need to be used as the new values for the second select box, i have placed these in a new collection.

After ready the documentation i assumed i could do this:

var newProducts = new App.Collections.Products(correct);
form.setValue({ ProductUsed : newProducts});

Where correct is an array of objects, however my select box just goes blank and allows me to select the other options when focused.

Any advice would be great?

Cheers,

Tom

1

There are 1 best solutions below

0
On

evilcelery shared this fiddle: jsfiddle.net/evilcelery/c5QHr

This resolves the issue i had.