Форма:
<form id="registrationForm">
<label for="Name">Name</label>
<input type="text" id="Name" placeholder="Name" name="name" required>
<label for="Email">E-mail</label>
<input type="text" id="Email" placeholder="E-mail" name="email" required>
<label for="Login">Login</label>
<input type="text" id="Login" placeholder="Login" name="login" required>
<label for="Password">Password</label>
<input type="password" id="Password" placeholder="Password" name="password" required>
<label for="ConfirmPassword">Confirm Password</label>
<input type="password" id="ConfirmPassword" placeholder="Confirm Password" name="confirm_password" required>
<input type="submit" value="Register">
</form>
Обработчик:
const form = document.querySelector('form');
form.addEventListener('submit', function(event) {
event.preventDefault();
console.log(this) // this - undefined
let formData = new FormData(form);
console.log(formData); // formData - пустой {}
})