diff --git a/src/PassReset/formHandler.js b/src/PassReset/formHandler.js index bae54e5..80809ba 100644 --- a/src/PassReset/formHandler.js +++ b/src/PassReset/formHandler.js @@ -1,5 +1,7 @@ const formEl = document.getElementById("reset"); -formEl.addEventListener('submit', (listener) => { +formEl.addEventListener('submit', (listener) => formHandler(listener)); + +function formHandler(listener){ listener.preventDefault(); const formData = new FormData(formEl); if(formData.get("newPW") === formData.get("newPWConfirm")){ @@ -26,4 +28,4 @@ formEl.addEventListener('submit', (listener) => { } else { document.getElementById('formStatus').innerHTML = "Failure: new passwords don't match"; } -}); \ No newline at end of file +} \ No newline at end of file