try event.preventDefault fix
This commit is contained in:
parent
f1e705ae5e
commit
fe07147d6c
5
login.js
5
login.js
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user