guildgate/templates/register.html

67 lines
2.0 KiB
HTML

{{ define "register" }}
{{ template "header" .}}
<body>
<div>
<form method="POST" action="/register">
<table>
<tr>
<td>Username:</td>
<td><input type="text" placeholder="username" name="username"</td>
<tr>
<td>Email Address:</td>
<td><input type="mail" placeholder="Email address" name="email"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" id="password" name="password" pattern="(?=.*\d)(?=.*[a-z]).{8,}" title="Must contain at least one number and at least 8 or more characters" required></td>
</tr>
<tr>
<td>Confirm Password:</td>
<td><input type="password" name="confirm_password" id="confirm_password" onchange="check()"/></td>
<td><span id='message'></span></td>
<td><input type="checkbox" onclick="showPass()">Show Passwords</td>
<tr>
<td>Secret Token:</td>
<td><input type="password" value="{{.Secret}}" name="secret"></td>
</tr>
<tr>
<td><input type="submit" value="Submit"></td>
</tr>
</table>
</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('password').value ===
document.getElementById('confirm_password').value) {
document.getElementById('message').innerHTML = "Passwords match";
} else {
document.getElementById('message').innerHTML = "Passwords don't match";
}
}
function showPass() {
var x = document.getElementById("password");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
var x = document.getElementById("confirm_password");
if (x.type === "password") {
x.type = "text";
} else {
x.type = "password";
}
}
</script>
{{ template "footer" .}}
{{ end }}