Question

I have this source of html

The problem is though I set 2 options as selected it only shows it sets the last one. No matter how many I set selected it only set the last one.

Why is that ?

[1](http://jsfiddle.net/prime/Lp7e7/)
Was it helpful?

Solution

Try setting the multiple attribute on the select element:

 <select id="businessFn" name="businessFn"  style="width: 225px" multiple>
         <option value="1"  >one</option>                          |________Here
         <option value="2" selected ='selected' >Two</option>
         <option value="3"  >Three</option>
         <option value="4" selected ='selected'  >four</option>
         <option value="5"  >five</option> 
 </select>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top