BUG: Adding OPTION to SELECT Box Contained by Non-Display Element May Lose Selection (298978)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 5.5
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 4.01 SP1
- Microsoft Internet Explorer (Programming) 4.01 SP2
- Microsoft Internet Explorer (Programming) 5
- Microsoft Internet Explorer (Programming) 5.01
- Microsoft Internet Explorer (Programming) 5.01 SP1
This article was previously published under Q298978 SYMPTOMS
When you add OPTION elements to a SELECT box, and the SELECT element is contained in an element that is set to display: none by using the style attribute, the selected OPTION value may be lost.
CAUSE
Internet Explorer is losing the selected OPTION value if that value is set before the options to the SELECT box are added.
RESOLUTION
To avoid the problem, set your container element to display: none by using script instead of by using the style attribute of the element.
To work around this problem, set the select value after you add the OPTION element to the SELECT box.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. REFERENCESFor more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
Modification Type: | Major | Last Reviewed: | 4/21/2006 |
---|
Keywords: | kbBug kbDHTML kbnofix KB298978 kbAudDeveloper |
---|
|