try preventDefault
This commit is contained in:
parent
fe07147d6c
commit
3bf0f9d0e4
6
login.js
6
login.js
@ -4,10 +4,7 @@ window.addEventListener("DOMContentLoaded", init);
|
|||||||
|
|
||||||
function init (){
|
function init (){
|
||||||
let formSubmitButton = document.querySelector("#submit");
|
let formSubmitButton = document.querySelector("#submit");
|
||||||
formSubmitButton.addEventListener("click", loginFormSubmitHandler(e));
|
formSubmitButton.addEventListener("click", async (e) => {
|
||||||
}
|
|
||||||
|
|
||||||
async function loginFormSubmitHandler (e) {
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let form = document.querySelector("form");
|
let form = document.querySelector("form");
|
||||||
let formData = new FormData(form);
|
let formData = new FormData(form);
|
||||||
@ -19,4 +16,5 @@ async function loginFormSubmitHandler (e) {
|
|||||||
catch (error) {
|
catch (error) {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user