473,700 Members | 2,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

<label> with <select> in IE6

Hello,

I am used to using the label tag with check boxes and radio buttons in
html forms. This allows me to click on the text of the label to
activate/deactivate the check box / button, rather than having to
click on the (possibly small) box or button.

I recently tried to assign a label to a select "drop down list", but
found that when I clicked on the label text to bring it into focus,
the select box was reset to the first entry. Is this normal?

The browser I used for this test was IE 6. Mozilla does not do this.
Is there a way to make IE stop changing the selected item in the
select list when I click on the label text?

Is it wrong to assign a label to a select box?

Sample URL is: http://www.sindar.net/html-reference.html (scroll way
down to the bottom of the page).

Thanks,

Brian.
Jul 23 '05 #1
5 8311
Brian Foley wrote:
I recently tried to assign a label to a select "drop down list", but
found that when I clicked on the label text to bring it into focus,
the select box was reset to the first entry. Is this normal?
Most likely not. The Specification says only:

"When a LABEL element receives focus, it passes the focus on to its
associated control." [1]

There is no mention nor anything that would imply that an implementation
should move the selected entry, in the case of a menu element.
The browser I used for this test was IE 6. Mozilla does not do this.
Is there a way to make IE stop changing the selected item in the
select list when I click on the label text?
Hum... I can't think of anything decent.
Is it wrong to assign a label to a select box?
Definitely not!
Sample URL is: http://www.sindar.net/html-reference.html (scroll way
down to the bottom of the page).


I could confirm the reported (mis)behavior on MS IE 6.0.2900.2180 on
Windows XP SP2. Normally, one would suggest the submission of a bug
report, but I don't think IE is going to receive any attention before
Longhorn.

[1] http://www.w3.org/TR/html4/interact/forms.html#h-17.9.1

Regards,

--
Ney André de Mello Zunino
Jul 23 '05 #2
Ney André de Mello Zunino <zu****@inf.ufs c.br> wrote:
Normally, one would suggest the submission of a bug
report, but I don't think IE is going to receive any attention before
Longhorn.


After the recent announcement about IE 7 for Windows XP, I would be more
optimistic about this. Not very optimistic, though.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html

Jul 23 '05 #3
/Brian Foley/:
The browser I used for this test was IE 6. Mozilla does not do this.
Is there a way to make IE stop changing the selected item in the
select list when I click on the label text?

Is it wrong to assign a label to a select box?


No, it is not wrong. It is just IE is wrong, as usual. :-)

Notice when you specify an 'accesskey' for the label (it is the only
way you could specify an 'accesskey' for a SELECT element) and use
that key to activate the select box - the "reset" behavior doesn't
happen.

--
Stanimir
Jul 23 '05 #4
Brian Foley wrote:
I recently tried to assign a label to a select "drop down list", but
found that when I clicked on the label text to bring it into focus,
the select box was reset to the first entry. Is this normal?

The browser I used for this test was IE 6. Mozilla does not do this.
Is there a way to make IE stop changing the selected item in the
select list when I click on the label text?


Here's a quick JavaScript workaround:
<http://tw.ecritters.bi z/html_examples/ie_select_label s/>.
Jul 23 '05 #5
* Leif K-Brooks <eu*****@ecritt ers.biz> on Sun, 20 Feb 2005 06:45:42 -0500 wrote:
Here's a quick JavaScript workaround:
<http://tw.ecritters.bi z/html_examples/ie_select_label s/>.


Thanks Leif -- very helpful.

I think, though, that it may simply be better to drop the labels from
my select elements. I usually lay my forms out in a two column th/td
table, so I suppose the relationship is obvious even without the
label.

Its a shame though...

Brian.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
35143
by: cedawe | last post by:
I have two select boxes. When the user picks a value in the first one it completely re-populates the second one. It works fine, but only generates a standard OPTIONS list and I now want to group the options using OPTGROUPs. <select name="Selector1" size="1" onchange="reload2(this.options.selectedIndex, document.Form1.Selector2)"> <option ..... </select>
10
7646
by: Ryan McGeary | last post by:
In a <select> drop-down, the onchange event isn't called when scrolling through the dropdown using the mouse-wheel and when crossing over a new <optgroup>. Using the example below, notice how the onchange event isn't called when mouse wheel scrolling between A3 and B1, but it works properly when scrolling between A1 and A2. E.g. ------------------------------------------
9
6047
by: aragon | last post by:
Hi all, is it legal to use a fully-numeric string as "name" attribute for the <select> tag in the XHTML standard? E.g.: <form action="action.php" method="get"> <select name="12345"> <option value="1">test</option> </select>
7
1953
by: Cezary | last post by:
Hi. I want to change language on my site online. So, I wrote this: <form action="<?= preg_replace("/&/", "&amp;", $_SERVER) ?>" method="post" name="change_lang_form"> <p style="display:none;"><input type="hidden" name="change_lang" value="1"> <label for="lang" accesskey="l">== <?= CHOOSE_LANG ?> ==</label></p> <p class="margin"><select id="lang" name="lang" class="langsection" onChange="if (this.options.value != 'null')
2
2025
by: VK | last post by:
A while ago there was a discussion how to implement a select list that would call a function right upon new selection is being made w/o clicking any additional buttons: <http://groups-beta.google.com/group/comp.lang.javascript/browse_frm/thread/aa4a8da635e42592/ba2c264d6a9b3558?q=drag+group:comp.lang.javascript+author:VK&rnum=2&hl=en#ba2c264d6a9b3558> The main issue was to overcome IE's accessibility bug: if user scrolls the list using...
7
10916
by: lambertb | last post by:
Hi, is this possible to achieve this, and how? http://img217.imageshack.us/img217/779/derrrvw2.png thanks!
7
1820
by: Smokey Grindle | last post by:
How can you correctly use the <labelelement in asp.net? does the label custom control corelate to this tag correctly in the same way in that if you click it it will select the tied element? thanks
3
2566
by: Homer J. Simpson | last post by:
I have the following stored procedure: ALTER PROCEDURE . AS BEGIN SET NOCOUNT ON; SELECT COUNT(*) FROM QUICKNOTES END ....and the following data source in my .aspx file:
12
2329
by: LayneMitch via WebmasterKB.com | last post by:
Hello everyone. I'm currently learning Javascript and doing a few exercises. One problem I'm working on takes an array of names from an xml file using Ajax and writes it to <select<optionstags. This is the code they use:
0
8726
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9214
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9075
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8925
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7810
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6561
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4404
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3089
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2392
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.