Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > HTML Select element: How to show drop-down list by clicking only once

Reply
Thread Tools

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

 
 
Stefan Mueller
Guest
Posts: n/a
 
      06-12-2008
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>
 
Reply With Quote
 
 
 
 
Robin Rattay
Guest
Posts: n/a
 
      06-13-2008
On 12 Jun., 14:34, Stefan Mueller <seekw...@yahoo.com> 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
 
Reply With Quote
 
 
 
 
Rich Grise
Guest
Posts: n/a
 
      06-13-2008
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

 
Reply With Quote
 
Stefan Mueller
Guest
Posts: n/a
 
      06-14-2008
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
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      06-14-2008
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
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      06-14-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
HTML Select element: How to show drop-down list by clicking only once Stefan Mueller Java 0 06-13-2008 11:33 AM
Show GreyBox Pop Up Only Once? sixstringsk Javascript 3 05-27-2008 11:29 PM
I want to be able to access the internet by opening my browser and not right clicking and then clicking connect. James Johnson Computer Support 1 05-15-2004 03:40 AM
select ID in drop down list and show name in text box without clicking submit button Matthew Louden ASP General 3 01-09-2004 09:52 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57