select option element onclick?

Discussion in 'Javascript' started by Christopher Benson-Manica, Apr 20, 2004.

  1. 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.
     
    Christopher Benson-Manica, Apr 20, 2004
    #1
    1. Advertising

  2. Christopher Benson-Manica

    Matt Kruse Guest

    "Christopher Benson-Manica" <> 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/
     
    Matt Kruse, Apr 20, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J. Hall
    Replies:
    2
    Views:
    1,117
    Jeff Thies
    Apr 21, 2004
  2. WebRaster
    Replies:
    1
    Views:
    291
    Francisco Spaeth
    Oct 26, 2005
  3. Nick Spacek

    Removing select option removes entire select

    Nick Spacek, Jun 21, 2006, in forum: Javascript
    Replies:
    1
    Views:
    161
    Matt Kruse
    Jun 21, 2006
  4. Replies:
    0
    Views:
    116
  5. Replies:
    7
    Views:
    236
Loading...

Share This Page