- From: Jon Jensen <notifications@github.com>
- Date: Mon, 30 Jan 2023 15:45:50 -0800
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 30 January 2023 23:46:03 UTC
Ooh that's a great point @LeaVerou!
There were discussions around this before I got involved, and the consensus was to add a [second optional argument](https://github.com/whatwg/xhr/issues/262#issuecomment-548720848), @annevk might be able to add some more context around those conversations.
I probably should have provided a better example, as it's a little clearer and more ergonomic for the the primary use case. Typically this would be used after a user clicks on a submit button, e.g. something like:
```javascript
myform.addEventListener("submit", e => {
e.preventDefault();
const formData = new FormData(e.target, e.submitter);
// do a fetch or something
});
```
or
```javascript
mybutton.addEventListener("click", e => {
e.preventDefault();
const formData = new FormData(e.form, e.target);
// do a fetch or something
});
```
--
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/812#issuecomment-1409530665
You are receiving this because you are subscribed to this thread.
Message ID: <w3ctag/design-reviews/issues/812/1409530665@github.com>
Received on Monday, 30 January 2023 23:46:03 UTC