When submitting a form on a website, the form is submitted twice.
Categories
(Core :: DOM: Forms, defect)
Tracking
()
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.
Comment 1•3 years ago
|
||
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.
Comment 2•3 years ago
|
||
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?
Comment 3•2 years ago
|
||
Close as INCOMPLETE as we aren't able to move forward with hearing back from comment 2.
Description
•