[Pass-reset] Crude form parser implemented

This commit is contained in:
eoghan.conlon 2023-07-27 00:27:51 +01:00
parent 310c4f7df0
commit 94f998fa1e

View file

@ -3,24 +3,32 @@
<head>
<meta charset="UTF-8" />
<title>Password reset</title>
<script src="formHandler.js"></script>
</head>
<body>
<form>
<label for="uid">Username</label>
<input type="text" id="uid" name="uid" /> <br />
<label for="oldPW">Old Password</label>
<input type="text" id="oldPw" name="oldPW" /> <br />
<label for="newPW1">New Password</label>
<input type="text" id="newPW1" name="newPW" /> <br />
<label for="newPW2">Confirm</label>
<input type="text" id="newPW2" name="newPWConfirm" /> <br />
<input type="Submit" value="Submit" />
</form>
<div>
<form name ="myForm" action="" method="get" id="form">
<label for="uid">Username</label>
<input type="text" id="uid" name="uid" /> <br />
<label for="oldPw">Old Password</label>
<input type="text" id="oldPw" name="oldPW" /> <br />
<label for="newPW1">New Password</label>
<input type="text" id="newPW1" name="newPW" /> <br />
<label for="newPW2">Confirm</label>
<input type="text" id="newPW2" name="newPWConfirm" /> <br />
<input type="Button" value="Submit" onclick="handleSubmit(this.form)" />
</form>
</div>
<footer>
UL Computer Society 2023-<span id="year">2023</span>
</footer>
</body>
<script>
document.getElementById('year').textContent = new Date().getFullYear().toString()
document.getElementById('year').textContent = new Date().getFullYear().toString();
function handleSubmit(form) {
let uid = form.uid.value;
console.log(uid);
}
</script>
</html>