I have three selects (html drop down lists), all contain the exact same values (except the ids of selects are different).
Now I want to do this:
-
When a user selects some option in the first select the same option is hidden in the other two. This rule applies to other two selects as well.
-
If the option in the second select is changed again then the previously selected option must reappear in the other selects.
I hope I was clear. I know this should probably be solved with javascript but I don’t have enough knowledge of it to write an elegant solution (mine would probably be very long). Can you help me with the this?
is the simplest way
http://api.jquery.com/hide/
try toggle it it matches your requirement
http://api.jquery.com/toggle/
you can call these
onchangeof the select boxif you want to hide individual options
use
.addClassand add class to that option to hide ithttp://api.jquery.com/addClass/