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

S

Stefan Mueller

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

Robin Rattay

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
 
R

Rich Grise

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
 
S

Stefan Mueller

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
 
J

Jonathan N. Little

Stefan said:
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.
 
J

Jonathan N. Little

Stefan said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top