2020-09-17 16:19:05 -04:00
{{ define "register" }}
{{ template "header" .}}
2020-08-20 12:51:02 -04:00
< body >
2020-09-17 17:47:12 -04:00
< div >
2020-08-20 13:08:45 -04:00
< 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 >
2020-09-17 19:53:02 -04:00
< 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 >
2020-08-20 13:08:45 -04:00
< / tr >
2020-09-17 17:47:12 -04:00
< tr >
< td > Confirm Password:< / td >
2020-09-17 19:53:02 -04:00
< td > < input type = "password" name = "confirm_password" id = "confirm_password" onchange = "check()" / > < / td >
2020-09-17 17:47:12 -04:00
< td > < span id = 'message' > < / span > < / td >
2021-03-02 14:26:58 -05:00
< td > < input type = "checkbox" onclick = "showPass()" > Show Passwords< / td >
2020-08-20 13:08:45 -04:00
< tr >
2021-03-02 14:26:58 -05:00
< td > Secret Token:< / td >
< td > < input type = "password" value = "{{.Secret}}" name = "secret" > < / td >
2020-08-20 13:08:45 -04:00
< / tr >
< tr >
< td > < input type = "submit" value = "Submit" > < / td >
< / tr >
< / table >
< / form >
2020-09-17 17:47:12 -04:00
< / 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() {
2020-09-17 19:53:02 -04:00
if(document.getElementById('password').value ===
document.getElementById('confirm_password').value) {
2020-09-17 17:47:12 -04:00
document.getElementById('message').innerHTML = "Passwords match";
} else {
document.getElementById('message').innerHTML = "Passwords don't match";
}
2021-03-02 14:26:58 -05:00
}
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";
}
2020-09-17 17:47:12 -04:00
}
< / script >
2020-09-17 16:19:05 -04:00
{{ template "footer" .}}
{{ end }}