I am trying to implement a form with checkboxes and comboboxes. If a chekbox is clicked, the combobox is updated with the order of clicked checkboxes.
For example, if I click all checkboxes, all the comboboxes should have options like "1","2","3"
. if I click first and third checkboxes, both comboboxes should have options "1"
and "2"
since only two checkboxes are clicked.
Here, I also want to update the selected option index according to my clicking order. For example, if i click the first checkbox, the corresponding combobox should have an option "1"
and this option should be selected index.
Until this part, It works like a charm.But,
if the checkbox is unchecked, the selected indexes are not preserved and no longer show the selected index properly.
I have done this http://jsbin.com/UjOYuVA/3/edit
So, the problem occurs when I unchecked the checkbox or checkboxes. How to fix that issue?