How I can select a multiple items in a <Select multiple> tag but not use Ctrl, Shift or any keyboard keys. I want to use mouse left click only WITHOUT DRAGING. How I can prevent unselection for other already selected options? In other words how to imitate Ctrl key on Select pulldown?
christoph weingarten
Ranch Hand
Joined: Oct 10, 2002
Posts: 39
posted
0
hi, i think there is no html-attribute to do so. but you could write a simple javascript-function. something like this would probably work: function doSelect(itemNo) { if (document.myForm.mySelection.options[itemNo].selected == true) { document.myForm.mySelection.options[itemNo].selected = false; } else { document.myForm.mySelection.options[itemNo].selected = true; } } you have to call this function everytime the user clicks on an option. i'm not sure, whether the code above runs. maybe you have to fix it a little bit regards christoph