diff --git a/src/PassReset/formHandler.js b/src/PassReset/formHandler.js index a3f00ab..791bb4e 100644 --- a/src/PassReset/formHandler.js +++ b/src/PassReset/formHandler.js @@ -17,9 +17,17 @@ formEl.addEventListener('submit', () => { event.preventDefault(); const formData = new FormData(formEl); if(formData.get("newPW") === formData.get("newPWConfirm")){ - alert("This works"); + formData.delete("newPWConfirm"); + const newPW = formData.get("newPW"); + formData.delete("newPW"); + formData.append("field", "password"); + formData.append("value", newPW); + const object = Object.fromEntries(formData.entries()); + console.log({ object }); + //TODO: Change this to changing a div in html + alert("Success"); } else { - alert("Shit"); + //TODO: Change this to changing a div in html + alert("Failure") } - console.log({ object }); }); \ No newline at end of file diff --git a/src/PassReset/index.html b/src/PassReset/index.html index d2697c9..f9d1b0f 100644 --- a/src/PassReset/index.html +++ b/src/PassReset/index.html @@ -6,10 +6,10 @@