try event.preventDefault fix

This commit is contained in:
Arthur Lu 2022-12-12 15:10:52 -08:00
parent f1e705ae5e
commit fe07147d6c

View File

@ -4,10 +4,11 @@ window.addEventListener("DOMContentLoaded", init);
function init (){ function init (){
let formSubmitButton = document.querySelector("#submit"); let formSubmitButton = document.querySelector("#submit");
formSubmitButton.addEventListener("click", loginFormSubmitHandler); formSubmitButton.addEventListener("click", loginFormSubmitHandler(e));
} }
async function loginFormSubmitHandler () { async function loginFormSubmitHandler (e) {
e.preventDefault();
let form = document.querySelector("form"); let form = document.querySelector("form");
let formData = new FormData(form); let formData = new FormData(form);
try { try {