Bug 99712 - Submit-buttons containing other elements does not trigger form submission
Summary: Submit-buttons containing other elements does not trigger form submission
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://junk.fizkerinc.dk/bugs/webkit-...
Depends on:
Reported: 2012-10-18 06:09 PDT by benjamin Horsleben
Modified: 2012-10-19 13:14 PDT (History)
1 user (show)

See Also:

same test as attachment (287 bytes, text/html)
2012-10-19 13:14 PDT, Alexey Proskuryakov
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description benjamin Horsleben 2012-10-18 06:09:52 PDT
When having a button-element with type=submit contain another element (such as a label), clicking the containing element will not trigger form-submission.

Clicking directly on the button (instead of the child element) will trigger submission as expected.

The example urls shows the minimum code that provokes this error. The form-submission prints the current time in a span after the form, to show that something has happened.

The button does receive click-events properly, so adding 'onclick=this.form.submit()' to the button will make the form submit, but that should not be necessary, and also avoids triggering the submit-event for the form.
Comment 1 Alexey Proskuryakov 2012-10-19 13:13:20 PDT
See also: bug 16868, bug 89041.
Comment 2 Alexey Proskuryakov 2012-10-19 13:13:50 PDT
Bug 15696, not 16868.
Comment 3 Alexey Proskuryakov 2012-10-19 13:14:08 PDT
Created attachment 169684 [details]
same test as attachment