Factoring the model user and correcting password
This commit is contained in:
parent
b8f125cb0f
commit
97c9d8def9
1 changed files with 5 additions and 1 deletions
|
@ -101,6 +101,7 @@ function changeGivenNameOrSurname () {
|
||||||
displayname = document.getElementById("displayname");
|
displayname = document.getElementById("displayname");
|
||||||
username = document.getElementById("username");
|
username = document.getElementById("username");
|
||||||
displayname.value = givenname.value + " " + surname.value
|
displayname.value = givenname.value + " " + surname.value
|
||||||
|
changeDisplayname();
|
||||||
}
|
}
|
||||||
function changeDisplayname () {
|
function changeDisplayname () {
|
||||||
givenname = document.getElementById("givenname");
|
givenname = document.getElementById("givenname");
|
||||||
|
@ -108,6 +109,7 @@ function changeDisplayname () {
|
||||||
displayname = document.getElementById("displayname");
|
displayname = document.getElementById("displayname");
|
||||||
username = document.getElementById("username");
|
username = document.getElementById("username");
|
||||||
username.value = displayname.value.toLowerCase().replace(/[^A-z0-9.-]/g, '').replace(/^[.-]/, '').replace(/[.-]$/, '');
|
username.value = displayname.value.toLowerCase().replace(/[^A-z0-9.-]/g, '').replace(/^[.-]/, '').replace(/[.-]$/, '');
|
||||||
|
changeUsername();
|
||||||
}
|
}
|
||||||
function changeUsername () {
|
function changeUsername () {
|
||||||
givenname = document.getElementById("givenname");
|
givenname = document.getElementById("givenname");
|
||||||
|
@ -117,8 +119,10 @@ function changeUsername () {
|
||||||
mail = document.getElementById("mail");
|
mail = document.getElementById("mail");
|
||||||
mail.value = username.value + "@lesgv.com";
|
mail.value = username.value + "@lesgv.com";
|
||||||
}
|
}
|
||||||
document.getElementById("username").addEventListener("change",changeUsername);
|
document.getElementById("givenname").addEventListener("change",changeGivenNameOrSurname);
|
||||||
|
document.getElementById("surname").addEventListener("change",changeGivenNameOrSurname);
|
||||||
document.getElementById("displayname").addEventListener("change",changeDisplayname);
|
document.getElementById("displayname").addEventListener("change",changeDisplayname);
|
||||||
|
document.getElementById("username").addEventListener("change",changeUsername);
|
||||||
</script>
|
</script>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
Loading…
Reference in a new issue