Forms dont submit when disabling submit button
https://bugs.webkit.org/show_bug.cgi?id=14443
Summary Forms dont submit when disabling submit button
Zachary Allia
Reported 2007-06-27 22:25:58 PDT
Forms do not submit when disabling the submit button via an onclick event, even when returning true.
Attachments
test case (117 bytes, text/html)
2007-07-19 05:32 PDT, Alexey Proskuryakov
no flags
Alexey Proskuryakov
Comment 1 2007-07-19 05:32:20 PDT
Created attachment 15579 [details] test case
Alexey Proskuryakov
Comment 2 2007-07-19 05:33:48 PDT
Confirmed with r24182. Works in Firefox.
Robert Sesek
Comment 3 2008-08-21 08:43:15 PDT
This is a regression from fixing https://bugs.webkit.org/show_bug.cgi?id=9245. Not sure how to go about fixing this, though...
Gérard Talbot (no longer involved)
Comment 4 2008-08-31 17:12:02 PDT
This bug seems to be the exact opposite of bug 16886. You guys should be talking to each others to sort this out because both bugs can not be confirmed.
Kaustubh Atrawalkar
Comment 5 2011-09-27 05:12:52 PDT
This seems to be old but existing issue. During initial implementation of SubmitInputType::handleDOMActivateEvent (revision - 72059 -http://trac.webkit.org/changeset/72059/trunk/WebCore/html/SubmitInputType.cpp) There was check added to see if submitButton->disabled() but this line will never hit infact the function will not be called if the button is disabled. In the use case, the onclick script it handled first making the button disabled and then continued to handleDOMActivateEvent where it returns due to disabled submitButton. Should be removed that check. Attaching patch.
Ryosuke Niwa
Comment 6 2011-09-27 09:18:33 PDT
Does IE submit in this case?
Kaustubh Atrawalkar
Comment 7 2011-09-27 10:39:16 PDT
(In reply to comment #6) > Does IE submit in this case? Nope. only Firefox has does complete form submission. MSIE & Opera does not. I think we might need to clear out again about this.
Ryosuke Niwa
Comment 8 2011-09-27 10:45:19 PDT
(In reply to comment #7) > (In reply to comment #6) > > Does IE submit in this case? > > Nope. only Firefox has does complete form submission. > MSIE & Opera does not. I think we might need to clear out again about this. Yes, we definitely need to figure out the right behavior on whatwg. Intuitively, I wouldn't expect the form to submit when the only submit button is disabled. This may as well as considered as a Gecko bug.
Kaustubh Atrawalkar
Comment 9 2011-09-27 10:52:37 PDT
(In reply to comment #8) > (In reply to comment #7) > > (In reply to comment #6) > > > Does IE submit in this case? > > > > Nope. only Firefox has does complete form submission. > > MSIE & Opera does not. I think we might need to clear out again about this. > > Yes, we definitely need to figure out the right behavior on whatwg. Intuitively, I wouldn't expect the form to submit when the only submit button is disabled. This may as well as considered as a Gecko bug. If you suggest, I will mail on whatwg for this issue. IMHO, until and unless form submit is not disabled, form submit action should happen on the click. But not sure with the compatibility of the browsers.
Ryosuke Niwa
Comment 10 2011-09-27 11:11:47 PDT
By the way, could you add yourself to committers.py so that Bugzilla's auto-completion can recognize you. Also, listing your IRC nick name will allow me to talk to you on #webkit more easily :)
Ryosuke Niwa
Comment 11 2011-09-27 11:17:52 PDT
ap suggests I add you myself. What's your IRC nickname?
Kaustubh Atrawalkar
Comment 12 2011-09-27 11:21:39 PDT
(In reply to comment #11) > ap suggests I add you myself. What's your IRC nickname? Sure, my IRC nickname is silverroots
Kaustubh Atrawalkar
Comment 13 2011-09-28 00:22:42 PDT
(In reply to comment #12) > (In reply to comment #11) > > ap suggests I add you myself. What's your IRC nickname? > > Sure, my IRC nickname is silverroots Thanks Ryosuke :)
Kaustubh Atrawalkar
Comment 14 2011-09-29 21:06:32 PDT
(In reply to comment #8) > > Yes, we definitely need to figure out the right behavior on whatwg. Intuitively, I wouldn't expect the form to submit when the only submit button is disabled. This may as well as considered as a Gecko bug. in this case, the submit button is active before clicking it, but on it's on click handler it is made disabled. Firefox seems to run both on click and on submit handlers in this case one followed by another.
Kaustubh Atrawalkar
Comment 15 2012-03-07 22:21:45 PST
The whatwg discussion thread - http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-January/034536.html As per Ian, we should be fixing this issue. Will provide a patch soon.
Darren Powers
Comment 16 2012-03-15 23:52:03 PDT
I seems to be having the same problem with links. On click event if I disable the link I would still expect the event to bubble and route the browser to the href value but nothing happens.
Kaustubh Atrawalkar
Comment 17 2012-03-16 01:25:56 PDT
(In reply to comment #16) > I seems to be having the same problem with links. > On click event if I disable the link I would still expect the event to bubble and route the browser to the href value but nothing happens. Yes, this might have issues with most of the elements. I am assuming handleDOMActiveEvent should be modified to make it more smarter so that it can handle such cases. Not sure thought.
Note You need to log in before you can comment on or make changes to this bug.