Last Comment Bug 685657 - Disabling button with JS, it will stay disabled after refresh
: Disabling button with JS, it will stay disabled after refresh
Status: RESOLVED DUPLICATE of bug 654072
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: 6 Branch
: x86_64 Windows 7
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
: Andrew Overholt [:overholt]
Depends on:
  Show dependency treegraph
Reported: 2011-09-08 13:13 PDT by mrzephy
Modified: 2014-01-16 08:39 PST (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

testcase (910 bytes, text/html)
2011-09-12 08:18 PDT, :aceman
no flags Details

Description User image mrzephy 2011-09-08 13:13:03 PDT
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:

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.
Comment 1 User image :aceman 2011-09-12 08:18:05 PDT
Created attachment 559864 [details]

Testcase from the link.
Comment 2 User image :aceman 2011-09-12 08:19:37 PDT
Confirming on the testcase, Win XP.
Comment 3 User image Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2011-09-12 08:29:17 PDT
Does this require jquery to reproduce?
Comment 4 User image Boris Zbarsky [:bz] (still a bit busy) 2011-09-12 08:31:28 PDT
Disabled state is persisted for buttons across a soft refresh, along with other form control state.  I believe there are existing bugs on that.
Comment 5 User image :aceman 2011-09-12 08:34:52 PDT
Is it intentional?
Comment 6 User image Boris Zbarsky [:bz] (still a bit busy) 2011-09-12 08:39:40 PDT
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.
Comment 7 User image mrzephy 2011-09-12 09:18:16 PDT
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.
Comment 8 User image Alice0775 White 2011-09-12 10:41:26 PDT
Dup Bug 654072
Comment 9 User image Alice0775 White 2011-09-12 10:47:33 PDT
and Bug 277724,Bug 300364 ?
Comment 10 User image Boris Zbarsky [:bz] (still a bit busy) 2011-09-12 16:35:34 PDT

*** This bug has been marked as a duplicate of bug 654072 ***

Note You need to log in before you can comment on or make changes to this bug.