HTML Select element: How to show drop-down list by clicking only once

Discussion in 'Java' started by Stefan Mueller, Jun 13, 2008.

  1. The following URL shows a HTML page with 3 Select elements (see code
    below):
    http://test.seekware.ch/test/

    If you use Internet Explorer...
    ... Section 1 (no color change) always shows the drop-down list by
    clicking once.

    ... Section 2 (color change only the first time) shows the first time
    the drop-down list only after clicking twice. Afterwards each click
    shows the drop-down list.

    ... Section 3 (color change each time) shows the drop-down list
    always only after clicking twice.

    Is there a way (e.g. with Java scripts) to enforce the Internet
    Explorer to show each drop-down list always by clicking once?

    Any information is very appreciated
    Stefan

    PS: With Opera each drop-down list is shown by clicking only once.
    Perfect! In Mozilla Firefox each drop-down list is shown the same way.
    Unfortunately you always have to click them twice (first click closes
    the previous drop-down list). I don't like this but I guess it works
    as designed and Mozilla users are used to it. Or is there a way to
    change this behavior?


    = = = = = = = = = = = =

    Code of HTML page (http://test.seekware.ch/test/)

    <html>
    <head>
    <style type = "text/css">
    select.stil_not-selected {
    background-color: #ffffff;
    }

    select.stil_selected {
    background-color: #888888;
    }
    </style>
    </head>

    <body>
    <select style = "width:100px">
    <option value = "">Selection 1
    <option value = "">1
    <option value = "">2
    <option value = "">3
    </select>

    <select style = "width:100px"
    onFocus = "className = 'stil_selected'"
    onBlur = "className = 'stil_selected'">
    <option value = "">Selection 2
    <option value = "">1
    <option value = "">2
    <option value = "">3
    </select>

    <select style = "width:100px"
    onFocus = "className = 'stil_selected'"
    onBlur = "className = 'stil_not-selected'">
    <option value = "">Selection 3
    <option value = "">1
    <option value = "">2
    <option value = "">3
    </select>
    </body>
    </html>
    Stefan Mueller, Jun 13, 2008
    #1
    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. weiwei
    Replies:
    0
    Views:
    1,001
    weiwei
    Jan 5, 2007
  2. Stefan Mueller
    Replies:
    5
    Views:
    2,335
    Jonathan N. Little
    Jun 14, 2008
  3. Matthew Louden
    Replies:
    3
    Views:
    253
    Ray at
    Jan 9, 2004
  4. Replies:
    5
    Views:
    252
  5. Replies:
    3
    Views:
    275
Loading...

Share This Page