• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiselection without Ctrl,Shift keys

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic