Question

When I add "multiple" attribute to select menu, it behaves differently & doesnt show all options in a drop down list.

How it looks:

enter image description here

Here's the html code:

<select name="advertLocation" multiple="multiple">
    <option value="--Select--">--Select--</option>
    <option style="color:#3366cb;" value="Public - No specific target"><b>Public - No specific target</b></option>
    <option>Afghanistan</option>
    <option>Albania</option>
    ......
</select>
Was it helpful?

Solution

When adding multiple="multiple" and since you cannot select multiple values in a drop-down list, the browser renders the element as a scrolled list box.

There is nothing you can do to change this behaviour.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top