Closed Bug 1778859 Opened 3 years ago Closed 2 years ago

When submitting a form on a website, the form is submitted twice.

Categories

(Core :: DOM: Forms, defect)

Firefox 102
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ryanmcly, Unassigned, NeedInfo)

References

()

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36

Steps to reproduce:

When submitting a form that has a <button> with type="submit" and onSubmit the form is e.preventDefault()'d, the onSubmit method is submitted twice.

Actual results:

The form gets submitted twice. HOWEVER, if the <button> element has type="button", the form only gets submitted once. I'm not sure if this is supposed to be expected behavior or not.

Expected results:

The form should have only submitted once.

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Forms' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Forms
Product: Firefox → Core

I cannot reproduce the reported issue with the simpletest testcase data:text/html,<form><button type="submit">button[type=submit]</button></form><script>document.querySelector("form").addEventListener("submit", e => { e.preventDefault(); alert("onsubmit"); })</script> both in 102 and Nightly.

Could you attach a minimum testcase to this bug?

Flags: needinfo?(ryanmcly)

Close as INCOMPLETE as we aren't able to move forward with hearing back from comment 2.

Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.