fake password stuff

This commit is contained in:
stryan 2020-09-17 17:47:12 -04:00
parent 7ba061682c
commit 10fb809271

View File

@ -1,6 +1,7 @@
{{ define "register" }} {{ define "register" }}
{{ template "header" .}} {{ template "header" .}}
<body> <body>
<div>
<form method="POST" action="/register"> <form method="POST" action="/register">
<table> <table>
<tr> <tr>
@ -12,8 +13,12 @@
</tr> </tr>
<tr> <tr>
<td>Password:</td> <td>Password:</td>
<td><input type="password" placeholder="Password" name="password"></td> <td><input type="password" id="psw" name="psw" pattern="(?=.*\d)(?=.*[a-z]).{8,}" title="Must contain at least one number and at least 8 or more characters" required></td>
</tr> </tr>
<tr>
<td>Confirm Password:</td>
<td><input type="password" name="confirm_password" id="confirm_psw" onchange="check()"/></td>
<td><span id='message'></span></td>
<tr> <tr>
<td>Secret:</td> <td>Secret:</td>
<td><input type="password" placeholder="secret" name="secret"></td> <td><input type="password" placeholder="secret" name="secret"></td>
@ -23,5 +28,24 @@
</tr> </tr>
</table> </table>
</form> </form>
</div>
<div id="requirements">
<h3>Password must contain the following:</h3>
<p id="letter" class="invalid">A <b>lowercase</b> letter</p>
<p id="capital" class="invalid">A <b>capital (uppercase)</b> letter</p>
<p id="number" class="invalid">A <b>number</b></p>
<p id="length" class="invalid">Minimum <b>8 characters</b></p>
</div>
<script>
function check() {
if(document.getElementById('psw').value ===
document.getElementById('confirm_psw').value) {
document.getElementById('message').innerHTML = "Passwords match";
} else {
document.getElementById('message').innerHTML = "Passwords don't match";
}
}
</script>
{{ template "footer" .}} {{ template "footer" .}}
{{ end }} {{ end }}