Results 1 to 3 of 3

Thread: Javascript in the options of a select box

  1. #1
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,395
    Thanks
    32
    Thanked 153 Times in 147 Posts
    Blog Entries
    34

    Default Javascript in the options of a select box

    1) CODE TITLE: Javascript in the options of a select box

    2) AUTHOR NAME: Arie Molendijk

    3) DESCRIPTION:
    In non-IE, we can call functions from inside a select box by putting the following in the options of the box:
    <option value="bla" onclick="some_function()"></option>

    This is not possible in IE. So I created a script that works in both IE and non-IE and that allows us to do function calls from within select boxes whose options have text corresponding to the contents of any given script. Using the script, we can do things like:
    <option value="some_function()" ></option>
    <option value="window.open('http://www.google.com')" ></option>

    4) URL TO CODE:
    http://www.let.rug.nl/molendyk/selec...n_options.html

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,815
    Thanks
    2
    Thanked 424 Times in 418 Posts

    Default

    very good, I will make a note of it
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,395
    Thanks
    32
    Thanked 153 Times in 147 Posts
    Blog Entries
    34

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •