Article ID: 314279 - Last Review: May 21, 2007 - Revision: 2.1 BUG: The FOR Attribute of the LABEL Object Resets FocusThis article was previously published under Q314279 On This PageSYMPTOMS
When you click a label that is associated with a select box, the element that you selected in the select box is reset to the first element on the list.
RESOLUTION
You can only work around this problem in Internet Explorer 6 by using the onfocusin event. You can basically store the selected index into a temporary variable and reset the index to that variable when the select box obtains focus. Use the following code as an example: STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. MORE INFORMATIONSteps to Reproduce the ProblemIn following the drop-down list box, the third element is selected. If you click the Citizenship Status Label, the selected element in the drop-down list is reset to the first element.REFERENCES
For more information about developing Web-based solutions for Internet Explorer, visit the following Microsoft Web sites:
Internet Explorer Web Site: http://msdn.microsoft.com/ie/
(http://msdn.microsoft.com/ie/)
For information about the properties and events that this article uses, visit the following Microsoft Web sites:
MSDN - for attribute
(http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/properties/htmlfor_1.asp)
MSDN - onfocusin event
(http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/events/onfocusin.asp)
APPLIES TO
| Article Translations
|

Back to the top
