Jquery multiple select (ctrl click) to multiple select (single click) -


i've been looking around online can't seem find straight answer question have.

i have multi-dropdown this:

<form action="form_action.asp"> <select name="cars" id="myselect" multiple>   <option value="volvo">volvo</option>   <option value="saab">saab</option>   <option value="opel">opel</option>   <option value="audi">audi</option> </select> <input type="submit"> </form> 

now know can select multiple items in list using ctrl+click.

i change single click.

i've tried few things:

  • simulating ctrl while clicking (which worst idea i've had week).
  • changing selected attribute. gets selection (the visual part of atleast) undone when click next item.

i'd prefer not use plugins, unless there no other clean way so.

try this.

<select multiple> - how allow 1 item selected?

working example: http://jsbin.com/odicu4


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -