-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Form submission element is absent from event.submitter
#55
Comments
I've also noticed that the submit button/element does not appear in formData object on submission events. Example // JS
document
.querySelector("form")
.addEventListener("submit", (event) => {
let formData = new FormData(event.currentTarget);
formData.get('FirstButton') // should be reference to <button/> but is undefined
});
// HTML
<form>
<button name='FirstButton' value='FirstValue'>First</button> // Click
<button name='SecondButton' value='SecondValue'>Second</button>
</form> |
I think this is a good feature request. I think that the Regarding the request about However, I think maybe the |
I think the names should be similar for the buttons only their values different. check https://www.youtube.com/watch?v=w2i-9cYxSdc&pp=ygUZUmVtaXgganMgc2luZ2xlIG11bHRpZm9ybQ%3D%3D |
When I submit a
<form/>
, I'd like to know which element submitted the form.In native HTML, I have access to the element that submitted the form via event.submitter
Read more about the event.submitter spec here
Example:
Expected:
event.submitter should be a reference to the DOM node
Received:
event.submitter is null
The text was updated successfully, but these errors were encountered: