Closed Bug 685657 Opened 13 years ago Closed 13 years ago

Disabling button with JS, it will stay disabled after refresh

Categories

(Core :: DOM: Core & HTML, defect)

6 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 654072

People

(Reporter: mrzephy, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1

Steps to reproduce:

If you disable a submit input button with javascript and then reload the page, the button will still be disabled.
Example HTML to reproduce: http://pastebin.com/5ExFWtT6


Actual results:

The button is disabled no matter how many times you refresh. You need to click in the URL bar and press enter to "really" reload the page with the button enabled.


Expected results:

The button should be enabled after a reload (F5, ctrl+r). This is how it works in all other browsers, e.g. Chrome. And it makes perfect sense for it to work that way.
Attached file testcase
Testcase from the link.
Confirming on the testcase, Win XP.
Status: UNCONFIRMED → NEW
Component: General → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → general
Does this require jquery to reproduce?
Disabled state is persisted for buttons across a soft refresh, along with other form control state.  I believe there are existing bugs on that.
Whiteboard: DUPEME
Is it intentional?
We have code to make it explicitly happen, so yes.

The big question is whether it's desired.  And the problem is that that depends on the use cases...  If the button is disabled in response to the values of other inputs on the page, for example, then restoring those values should also restore the disabled state.
It's not consistent with other browsers. And if you ask me, the coder (JS) should take care of these things, not the browser itself. E.g. run validations on DOM load. There is just too many cases where this is not the desired behavior.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: