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

Discussion in 'HTML' started by Stefan Mueller, Jun 12, 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 12, 2008
    #1
    1. Advertising

  2. Stefan Mueller

    Robin Rattay Guest

    Re: HTML Select element: How to show drop-down list by clicking onlyonce

    On 12 Jun., 14:34, Stefan Mueller <> wrote:
    > 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.


    Which IE? Using IE6 I can't confirm this. All three select elements
    behave exactly the same to me.

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


    You can't (en)force anything on the web.

    BTW, its "JavaScript". It has nothing to do with Java.

    This is very basic operating system (or window manager) functionality
    completly outside of the scope of the DOM that JavaScript can
    manipulate.

    Keep in mind the the browser/operation system doesn't even have to
    show a drop-down list here. There are plenty of other methods to
    select a single entry out of a list.

    > PS: With Opera each drop-down list is shown by clicking only once.
    > Perfect!


    Accually I'd consider this a bug - see below.

    > 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).


    This is the standard behavior of Windows when handling drop-down
    lists, so I'd consider this correct and thus Opera's implementation
    buggy.

    If you want to change this you'd probably need to change operationg
    systems to one that does it differently, or that can be configured to
    behave how you want it.

    > I don't like this but I guess it works
    > as designed and Mozilla users are used to it.


    More like "Windows" users.

    > Or is there a way to
    > change this behavior?


    I doubt Windows has such an option.

    > <html>


    DOCTYPE?

    > <select style = "width:100px"
    > onFocus = "className = 'stil_selected'"
    > onBlur = "className = 'stil_selected'">


    I'd use "this.className" here - just in case.

    Robin
     
    Robin Rattay, Jun 13, 2008
    #2
    1. Advertising

  3. Stefan Mueller

    Rich Grise Guest

    On Thu, 12 Jun 2008 05:34:30 -0700, Stefan Mueller wrote:

    > 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?


    No, you have to click to close any drop-down list - either on the input
    box part, or to leave it as is, anywhere on the desktop.

    Do an experiment - reload the page, and do the same thing but in the
    reverse order. You'll find that item 3 opens on one click, and then
    2 and 1 need 2, the first one to close the previous box.

    Hope This Helps!
    Rich
     
    Rich Grise, Jun 13, 2008
    #3
  4. Re: HTML Select element: How to show drop-down list by clicking onlyonce

    Robin, I'm using IE7.
    Unfortunately I don't have a PC with IE6 anymore. However if you tell
    me that with IE6 all three select elements behave exactly the same
    then Microsoft has changed the behavior in IE7. Therefore it seems to
    be a bug in IE7.

    Stefan
     
    Stefan Mueller, Jun 14, 2008
    #4
  5. Re: HTML Select element: How to show drop-down list by clicking onlyonce

    Stefan Mueller wrote:
    > Robin, I'm using IE7.
    > Unfortunately I don't have a PC with IE6 anymore. However if you tell
    > me that with IE6 all three select elements behave exactly the same
    > then Microsoft has changed the behavior in IE7. Therefore it seems to
    > be a bug in IE7.


    http://labs.insert-title.com/article795.aspx
    Multiple IEs In Windows Web Design, Web Development And Ecommerce Tutorials.

    I have IE3-7 on my system.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 14, 2008
    #5
  6. Re: HTML Select element: How to show drop-down list by clicking onlyonce

    Stefan Mueller wrote:
    > Robin, I'm using IE7.
    > Unfortunately I don't have a PC with IE6 anymore. However if you tell
    > me that with IE6 all three select elements behave exactly the same
    > then Microsoft has changed the behavior in IE7. Therefore it seems to
    > be a bug in IE7.


    Damn. I attached the wrong link, should have been:

    http://tredosoft.com/Multiple_IE
    Install multiple versions of IE on your PC | TredoSoft

    Also:

    http://browsers.evolt.org/?ie/32bit/standalone
    evolt.org - Browser Archive IE

    Think beyond IE:

    http://browsers.evolt.org/
    evolt.org - Browser Archive

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 14, 2008
    #6
    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,024
    weiwei
    Jan 5, 2007
  2. Stefan Mueller
    Replies:
    0
    Views:
    483
    Stefan Mueller
    Jun 13, 2008
  3. Matthew Louden
    Replies:
    3
    Views:
    275
    Ray at
    Jan 9, 2004
  4. Replies:
    5
    Views:
    274
  5. Replies:
    3
    Views:
    291
Loading...

Share This Page