Closed
Bug 476333
Opened 16 years ago
Closed 14 years ago
Refreshing a page doesn't reflect a change in a selected option of a select element
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: r_rom, Unassigned)
Details
(Whiteboard: [CLOSEME 2010-12-01])
Attachments
(1 file)
1.09 MB,
application/zip
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)
Consider the following code:
<select>
<option value="0" selected="selected">0</option>
<option value="1">1</option>
<option value="2">2</option>
</select>
Refreshing a page (by pressing F5 or clicking the refresh toolbar button) doesn't reflect a change in the selected attribute. The source of a page reflects all changes to the code, but what's displayed doesn't change. Only placing the cursor into the browser URL bar and pressing Enter makes Firefox display the change in the selected attribute.
Reproducible: Always
Steps to Reproduce:
1. Load a page with the provided code.
2. Change which option is selected.
3. Refresh the page (e.g. by pressing F5).
Actual Results:
No visible change occurs.
Expected Results:
The newly selected option should be displayed as selected.
This bug is probably related to what's reported in bug 453680.
This is not a bug. Unless you Shift Refresh Firefox will retain the values you have filled into the form so you don't lose them. This is the way it works for all form fields.
This doesn't make sense to me. If I refresh a page, I don't expect to retain field values. Why would I want to refresh the page if I wanted to keep the values?
Comment 4•15 years ago
|
||
I wanted to add a little to this bug, because I encountered it this morning. If I use the above code and follow the instructions I can reproduce the problem. The code provided doesn't really illustrate the real issue with this bug. I will attempt to describe my problem.
I use a select box similar to the code provided in a form (Screen 1 - Select Plugin select box). Depending on which option is selected a piece of javascript will have other elements visible on the form (Screen 2). Also, the form does error checking so that the user has to meet all of the forms criteria before being allowed to successfully submit the form. I am working in Ruby on Rails with this form and not using javascript to do the validation. With me so far?
If I submit a form that has an error on it and I have one of the select options checked the form returns correctly and that selected item, along with whatever the javascript is displaying is still visible (Screen 3). If I now change the select box (Screen 4), you will notice that the javascript has re-hidden some of the HTML. If I now hit reload I get the message (Screen 5):
"To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier."
Now, because the select button in the first submission was set to "auto_copier" (value 1) that was actually resubmitted back to the form. Notice the plugin_id=>"1" in both requests below.
---- Original request ----
Processing TasksController#create (for 127.0.0.1 at 2009-10-09 09:29:54) [POST]
Parameters: {"commit"=>"Add Task", "action"=>"create", "authenticity_token"=>"1LbwAT2xUYqAYsbT6tT2YF+PLhBY2KVaQHokFx9fWKU=", "auto_copier"=>{"fake_param"=>"", "fake_param2"=>"0", "fake_param3"=>""}, "id"=>"", "task"=>{"remote_directory"=>"", "remote_password"=>"[FILTERED]", "position"=>"", "plugin_id"=>"1", "pgp_textmode"=>"0", "pgp_file"=>"0", "pgp_id"=>"", "remote_hostname"=>"", "passfile"=>"", "sign_pgp_file"=>"0", "action"=>"", "delete_files"=>"0", "transfer_type"=>"", "enabled"=>"0", "compress_files"=>"0", "key_file"=>"", "remote_username"=>"", "password_for_zipfile"=>"[FILTERED]", "pgp_signing_id"=>"", "getfiles"=>"", "downcase_files"=>"0", "remote_port"=>""}, "controller"=>"tasks", "vault_id"=>"1"}
---- END ----
---- RELOAD ----
Processing TasksController#create (for 127.0.0.1 at 2009-10-09 09:30:31) [POST]
Parameters: {"commit"=>"Add Task", "action"=>"create", "authenticity_token"=>"1LbwAT2xUYqAYsbT6tT2YF+PLhBY2KVaQHokFx9fWKU=", "auto_copier"=>{"fake_param"=>"", "fake_param2"=>"0", "fake_param3"=>""}, "id"=>"", "task"=>{"remote_directory"=>"", "remote_password"=>"[FILTERED]", "position"=>"", "plugin_id"=>"1", "pgp_textmode"=>"0", "pgp_file"=>"0", "pgp_id"=>"", "remote_hostname"=>"", "passfile"=>"", "sign_pgp_file"=>"0", "action"=>"", "delete_files"=>"0", "transfer_type"=>"", "enabled"=>"0", "compress_files"=>"0", "key_file"=>"", "remote_username"=>"", "password_for_zipfile"=>"[FILTERED]", "pgp_signing_id"=>"", "getfiles"=>"", "downcase_files"=>"0", "remote_port"=>""}, "controller"=>"tasks", "vault_id"=>"1"}
---- END ----
So far we are totally good. This is the exact behavior that I expect. However, when the page reloads it retains the change in the select box (I moved it back to the blank setting - Screen 6) but because the form was re-submitted with plugin_id=>"1" my javascript thinks the "auto_copier" option was still selected and it displays its apropriate HTML. This produces a really ugly visual effect and because my form relies on the select box and the extra config that the javascript makes visible, my form breaks.
In comment #2 Jayden claims this is not a bug. If I hit Shift-Reload as suggested the form values correct themselves as intended. I think this however should be the default behavior because in all other browsers tested (Safari 4.03 - Mac, Chrome 4.0.220.1 - Mac, IE 7 - Windows ) it is this way and it seems to me that this should be the desired effect. There is no way for me to detect a reload as a form-resubmit so therefore I can't code around this visual anomaly.
Comment 5•15 years ago
|
||
Comment 6•15 years ago
|
||
Please ignore Screen6 in my attachment. Screen7 is really Screen6!
Comment 7•14 years ago
|
||
Reporter, please retest with Firefox 3.6.12 or later in a fresh profile (http://support.mozilla.com/kb/Managing+profiles). Also update your plugins (flash, adobe reader, java, quicktime, silverlight, etc.) Go to the developer's website and download the latest version from there. If you no longer see this issue, please close this bug as RESOLVED, WORKSFORME. If you do see the bug, please post a comment.
Whiteboard: [CLOSEME 2010-12-01]
Comment 8•14 years ago
|
||
No reply, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•