Sunday 8 September 2013

Automatically selecting the proper option in select box

Automatically selecting the proper option in select box

I am trying to implement a form with checkboxes and comboboxes. If a
chekbox is clicked, the combobox is updated with number of currrent
clicked checkboxes. For example, if I click all checkboxes, all the
comboboxes should display 1,2,3 for ordering. if I click first and third
checkboxes, both comboboxes should display 1 and 2 since only two elements
are clicked. Here I also want to get the proper order appear. So, if you
first click a checkbox, the combobox shows 1. If you click one more
checkbox, the second combobox should show 1 and 2 and 2 index is selected
index. If you click one more checkbox, the third combobox shows 1,2,3 and
3 index is selected. I have done this http://jsbin.com/UjOYuVA/3/edit to
do that, it works but if the checkbox is unchecked, i lost the selection
order (selected index).
So, the problem occurs if I checked all three chekboxes and then unchecked
say the second checkbox. How to fix that issue?

No comments:

Post a Comment