[Pass-reset] Extracting now working form to its own file for readability of html code

This commit is contained in:
eoghan.conlon 2023-07-27 00:50:28 +01:00
parent 862cdebfae
commit 77042a184a
2 changed files with 13 additions and 14 deletions

View file

@ -0,0 +1,13 @@
function handleSubmit(form) {
const field = "password"
const user = form.uid.value;
const pass = form.oldPW.value;
const newPW = form.newPW.value;
const newPWConfirm = form.newPWConfirm.value;
if (newPW === newPWConfirm){
let obj = { "user": user , "pass": pass , "field": field, "value": newPW }
alert("Form submitted");
} else {
alert("New passwords doesn't match");
}
}

View file

@ -25,19 +25,5 @@
</body>
<script>
document.getElementById('year').textContent = new Date().getFullYear().toString();
function handleSubmit(form) {
const field = "password"
const user = form.uid.value;
const pass = form.oldPW.value;
const newPW = form.newPW.value;
const newPWConfirm = form.newPWConfirm.value;
if (newPW === newPWConfirm){
let obj = { "user": user , "pass": pass , "field": field, "value": newPW }
alert("Form submitted");
} else {
alert("New passwords doesn't match");
}
}
</script>
</html>