Suppose we have 5 checkboxes and each has unique value mapped with respective list of elements, just in my case I have associative PHP array –
[100] => Array ( [0] => Array ( [name] => NameABC [sid] => 109 )
[1] => Array ( [name] => NameDEF [sid] => 110 )
)
[101] => Array ( [0] => Array ( [name] => NamePQR [sid] => 337 )
[1] => Array ( [name] => NameXYZ [sid] => 339 )
)
so the values can be mapped with each list, now by the property of checkbox you can select more than one checkbox (unlike radio button), so when such case comes the drop down list that is being populated on the basis of each checkbox selection, now comes in a merged format like on selecting OPTION 1 and OPTION 2 both the list contains all the elements mapped to both, further on de-selecting it comes back to unmerged state.
Finally after iterations on my own question, I found almost correct answer for the same. Below is the HTML snippet used by me in this —
And now most important is the jquery part —
For this I am able to get values in the drop-down merged on selecting two or more check-boxes and further on un-checking any one, removes the respective contents from the list below.
NOTE: the HTML displayed above contains smarty tags and also have some PHP variables like “$assigner” etc.