Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > select option element onclick?

Reply
Thread Tools

select option element onclick?

 
 
Christopher Benson-Manica
Guest
Posts: n/a
 
      04-20-2004
Apparently you can't use the onclick event handler for specific
options in a select element in IE - is that correct? If so, is there
a way to get the same functionality out of it? What I want to do is
have a select box where you can select multiple elements without
holding down the control key; when you click on an option, you toggle
its selected property. How can I do that?

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cyberspace.org | don't, I need to know. Flames welcome.
 
Reply With Quote
 
 
 
 
Matt Kruse
Guest
Posts: n/a
 
      04-20-2004
"Christopher Benson-Manica" <(E-Mail Removed)> wrote:
> What I want to do is
> have a select box where you can select multiple elements without
> holding down the control key; when you click on an option, you toggle
> its selected property. How can I do that?


This can be done by storing the selected options, and re-selecting each time
the user clicks.
For an example, see:
http://www.mattkruse.com/temp/easier-multi-select.html

--
Matt Kruse
Javascript Toolbox: http://www.mattkruse.com/javascript/


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
programmatically select an option in "select" box in html rvelosoo Javascript 1 08-13-2008 10:53 AM
<select> <option> an element in DOM ? John Grandy ASP .Net Web Controls 1 05-11-2007 09:35 AM
Removing select option removes entire select Nick Spacek Javascript 1 06-21-2006 04:45 PM
modify the default option in a select changing another select WebRaster Javascript 1 10-26-2005 10:36 AM
Selection from One SELECT changes selected option of another SELECT? J. Hall HTML 2 04-21-2004 05:36 PM



Advertisments