8000 Implement `formdata` event · Issue #3799 · jsdom/jsdom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Implement formdata event #3799

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

Open
MartijnCuppens opened this issue Dec 5, 2024 · 0 comments
Open

Implement formdata event #3799

MartijnCuppens opened this issue Dec 5, 2024 · 0 comments

Comments

@MartijnCuppens
Copy link
MartijnCuppens commented Dec 5, 2024

It seems like the formdata event is not implemented.

Basic info:

  • Node.js version: 20.14.0
  • jsdom version: 25.0.1

Minimal reproduction case

const {JSDOM} = require('jsdom');
new JSDOM(`<!DOCTYPE html><html lang="en">
<body>
<form action="" id="form" method="post">
  <div>
    <label for="name">Name</label>
    <input name="name" id="fullName" type="text" value="Elvis Presley">
  </div>
</form>
<script>
console.log(fullName.value);
addEventListener('formdata', () => {
  console.log('This line should be logged');
});
const data = new FormData(form);
</script>
</body>
</html>`, { runScripts: "dangerously" });

How does similar code behave in browsers?

Expected behaviour in console

Elvis Presley
This line should be logged

Current behaviour

Elvis Presley

Browser demo: https://codepen.io/MartijnCuppens/pen/azodpRG?editors=1011


(Edit:) Seems like you knew this already:

// TODO: formdata event

@domenic domenic added the feature label Jan 9, 2025
@domenic domenic changed the title formdata event not implemented Implement formdata event Mar 8, 2025
@domenic domenic removed the feature label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0