[Pass-reset] Extracting now working form to its own file for readability of html code
This commit is contained in:
parent
862cdebfae
commit
77042a184a
2 changed files with 13 additions and 14 deletions
13
src/PassReset/formHandler.js
Normal file
13
src/PassReset/formHandler.js
Normal 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");
|
||||
}
|
||||
}
|
|
@ -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>
|
Loading…
Reference in a new issue