Is it possible to pre-select some multiselex parameters that will not be canceled when a new option is added?
Now I have the usual multiple selectbox, which parameters will be preselected by PHP:
<select name="selectbox" multiple> <option value="A">A</option> <option value="B" selected>B</option> <option value="C">C</option> <option value="D" selected>D</option> </select>
When I click on option A, options B and D will be canceled and A. will be selected. I would only like to deselect an item when someone clicks on an option already selected. When someone clicks on a parameter that is not already selected, it must be added to the already selected elements.
What is the best way to do this? Or is it not possible?
source share