Bug 14443 - Forms dont submit when disabling submit button
: Forms dont submit when disabling submit button
Status: NEW
: WebKit
Forms
: 523.x (Safari 3)
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To:
: http://gifts.30boxes.com/broken.html
:
:
: 39021
  Show dependency treegraph
 
Reported: 2007-06-27 22:25 PST by
Modified: 2012-03-16 01:25 PST (History)


Attachments
test case (117 bytes, text/html)
2007-07-19 05:32 PST, Alexey Proskuryakov
no flags Details


Note

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


Description From 2007-06-27 22:25:58 PST
Forms do not submit when disabling the submit button via an onclick event, even when returning true.
------- Comment #1 From 2007-07-19 05:32:20 PST -------
Created an attachment (id=15579) [details]
test case
------- Comment #2 From 2007-07-19 05:33:48 PST -------
Confirmed with r24182. Works in Firefox.
------- Comment #3 From 2008-08-21 08:43:15 PST -------
This is a regression from fixing https://bugs.webkit.org/show_bug.cgi?id=9245. Not sure how to go about fixing this, though...
------- Comment #4 From 2008-08-31 17:12:02 PST -------
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.
------- Comment #5 From 2011-09-27 05:12:52 PST -------
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.
------- Comment #6 From 2011-09-27 09:18:33 PST -------
Does IE submit in this case?
------- Comment #7 From 2011-09-27 10:39:16 PST -------
(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.
------- Comment #8 From 2011-09-27 10:45:19 PST -------
(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.
------- Comment #9 From 2011-09-27 10:52:37 PST -------
(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.
------- Comment #10 From 2011-09-27 11:11:47 PST -------
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 :)
------- Comment #11 From 2011-09-27 11:17:52 PST -------
ap suggests I add you myself. What's your IRC nickname?
------- Comment #12 From 2011-09-27 11:21:39 PST -------
(In reply to comment #11)
> ap suggests I add you myself. What's your IRC nickname?

Sure, my IRC nickname is silverroots
------- Comment #13 From 2011-09-28 00:22:42 PST -------
(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 :)
------- Comment #14 From 2011-09-29 21:06:32 PST -------
(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.
------- Comment #15 From 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.
------- Comment #16 From 2012-03-15 23:52:03 PST -------
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.
------- Comment #17 From 2012-03-16 01:25:56 PST -------
(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.