PRB: SELECTED Attribute Not Honored After Refresh

ID: Q185123


The information in this article applies to:


SYMPTOMS

After a page is refreshed, the SELECTED attribute of the <OPTION> tag within a <SELECT></SELECT> is not honored. (See "Steps to Reproduce Behavior" section below).

The expected behavior is that Internet Explorer 3.02 and Netscape Navigator 4.0 change the <SELECT> boxes back to their default options when the page is refreshed.


CAUSE

Internet Explorer persists the state of the <SELECT> and the stored state is reloaded whenever Internet Explorer navigates through entries in the History list. This includes the back and forward arrows, the lists accessible from those arrows, the history list accessible from the Object Model, and yes, the Refresh button, which is equivalent to going to the most recent item in History.

Reopening the same URL causes the <SELECT> control to have the original state, as that action does not go through the history.


STATUS

This behavior is by design.


MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a Web page with the following content:
    
    <HTML>
    <HEAD></HEAD>
    <BODY>
       <SELECT SIZE="1" NAME="MyList">
          <OPTION VALUE="Zero">Zero
          <OPTION VALUE="One">One
          <OPTION VALUE="Two" SELECTED>Two
       </SELECT>
       <BR>
    </BODY>
    </HTML> 


  2. Navigate to the Web page that you just created.


  3. Select item "One" in the SELECT control.


  4. Refresh the page by pressing F5.


The SELECT control will have item "One" selected rather than item "Two," which is the default.


REFERENCES

For more information, please see the MSDN Web Workshop:

http://msdn.microsoft.com/workshop/default.asp

Additional query words: kbHTML kbIE400 kbInternet kbIE401


Keywords          : kbIE400 kbIE401 kbIE500 
Version           : WINDOWS:4.0,4.01
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: April 30, 1999