#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    155
    Rep Power
    13

    select option javascript events


    Hi all. I was looking at devguru.com's HTML reference for the valid javascript events which can be used with an <option> tag.

    http://www.devguru.com/Technologies/...ml_option.html

    It lists the following events:

    onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, and onmouseup.

    However, NONE of these seem to have any effect. Here's the code I'm using:

    Code:
    <form name="CMS_published_items">
    <select name="items" size="5" multiple>
    <option value="#" ondblclick="alert('foo');">UNBC Home Page</option>
    <option value="#" ondblclick="alert('foo');">About</option>
    </select>
    </form>
    I've tried a bunch of the events but nothing has any result. They don't report any errors, they just do NOTHING.

    Does anyone have any idea why this is happening?

    Thanks much in advance,
    Pablo
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Pennsylvania
    Posts
    6
    Rep Power
    0

    On Select Tag


    Interesting, it doesn’t work at all on the option tags. However, it works fine on the select tag. You might consider using it there. Of course, you’ll need to check the options collection to determine what has been selected. Hope this helps.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2002
    Posts
    155
    Rep Power
    13
    Thanks Ed. I thought I tried putting in the select tag but I guess I'd done something wrong.

    This will work out fine, as I want people to be able to double click a menu item and then open a small window with values prefilled based on the selected index.

    Thanks!

    Pablo

IMN logo majestic logo threadwatch logo seochat tools logo