Closed Bug 256823 Opened 20 years ago Closed 20 years ago

selected element inside SELECT tag does not change when I click refresh , though html source changed.

Categories

(SeaMonkey :: General, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 46845

People

(Reporter: spanishguitar, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

I am developing Struts application and testing it on different browsers.
I`ve got the following situation, when using Firefox 0.9.2 and Netscape 7.1
browsers: when I open a web page, which contains SELECT tag with one item
selected (i.e. HTML:<select>...<option value="5bdc159dc0a801015a6bf4bab37054"
selected="selected">economist</option>...</select>) the first time everything is
OK and the right option is choosen. But then the HTML of the page is changed in
my program (it is dynamically generated), so when I click "refresh", browser
receives new HTML where another element is selected. When I choose "View page
source" I see this new HTML source text. But the browser shows that the old
element is chosen. On Opera 7.11 and MS Explorer 5.0 everything is OK.


Reproducible: Always
Steps to Reproduce:
1. Copy/paste test text 1 provided to new HTML file
2. Open it in browser (Netscape 7.11, Firefox 0.9.2)
3. See that element "3" is selected
4. Copy/paste test text 2 provided to same HTML file and save it
5. Click "reload" in browser
6. See that element "3" is still selected
7. Click "View page source" to ensure that the selected element must be "2"
Actual Results:  
selected element is "3"

Expected Results:  
selected element is "2"

Test 1:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form>
<select name="organizationInfo">
<option value="1" >1</option>
<option value="2"> 2</option>
<option value="3" selected="selected"> 3</option>
<option value="4">4</option>
</select>
</form>
</body>
</html>

Test 2:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form>
<select name="organizationInfo">
<option value="1" >1</option>
<option value="2" selected="selected"> 2</option>
<option value="3"> 3</option>
<option value="4">4</option>
</select>
</form>
</body>
</html>
It's possible this behavior is intentional - Mozilla remembers a little bit
about   values entered/selected in forms.  The question is, when a user goes to
a page they visited (reload, back) and the HTML has changed the default select
option, do we remember their old choice anyway, or update to the new default?

I'd think the current behavior is probably best (the user knows the values that
will be selected are ALL his choices, or none, but not a mix of items whose HTML
default changed and others that didn't).
(In reply to comment #1)

I don`t think that it is "the best" behavior. I`m developing web interface to an
application that will certainly have multiple users. If some user has changed
the object property (which is displayed using SELECT tag) there is no way for
another one to be up to date, because reloading the page does not help. 
If the page is reloaded, I, as user, is sure that browser shows it RELOADED. And
if the page is reloaded, it means that it has NEW version and may have another
properties.
If I don`t need to RELOAD it to get NEW version there is browser cache anyway.
If I, as developer, need to save user`s preferences I can do it by myself (in
session, cookies or anywhere else).
That`s my point of view and I see this feature as a bug.

Hold shift when you press the reload button (?)

*** This bug has been marked as a duplicate of 46845 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
It seems self evident to me that if the rendering disagrees with the underlying
html, as is the case when the selected option of a select list is not in fact
"selected", this is a gross bug, which makes it impossible to create dynamic web
pages that behave properly and predictably on Mozilla.

--Frank Hanny 
fchanny@lbl.gov
You need to log in before you can comment on or make changes to this bug.