I have come across various solutions to this problem online.
Basically, I have to keep ctrl a little cheesy, and I want the selection list to just select everything I click on and add it to the currently selected items.
I already have this code:
$("select[multiple] option").mousedown(function () { var $self = $(this); if ($self.attr("selected")) { $self.removeAttr("selected", ""); } else { $self.attr("selected", "selected"); } return false; });
Element
<select multiple id="WOStatusKey" name="WOStatusKey"> <option value="1">Created</option> <option value="2">In Process</option> </select>
It works great with one exception: at any time, something is selected / canceled that is not at the top of the list (where you have to scroll it to see it), after which you will select it up after selecting it. I played a little with him, but I canβt understand anything to prevent this behavior. In addition, I saw a couple of other solutions to this problem, although nothing is working or not working well.
I only need this to work in Chrome. Also, I'm not interested in alternatives for using a picklist.
Thanks for any help, this is much appreciated.
javascript jquery html
Zatos Jul 03 '14 at 2:06 a.m. 2014-07-03 02:06
source share