guichet/static/javascript/lesgv.js

27 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-07-17 11:09:53 +00:00
function addResDigitaOrg (id) {
2023-07-19 06:04:29 +00:00
if (document.getElementById(id).value.split("@")[1] && !["lesgrandsvoisins.com","resdigita.com","resdigita.org","lesgv.com","lesgv.org"].includes(document.getElementById(id).value.split("@")[1])) {
document.getElementById(id).value = document.getElementById(id).value.split("@")[0] + "@lesgrandsvoisins.com";
}
2023-07-17 11:09:53 +00:00
return document.getElementById(id).value;
}
2023-07-17 10:49:36 +00:00
function addResDigitaOrgIdValue () {
2023-07-17 11:09:53 +00:00
document.getElementById("mail").value = addResDigitaOrg("idvalue");
}
function addResDigitaOrgMail () {
document.getElementById("idvalue").value = addResDigitaOrg("mail");
2023-07-17 10:49:36 +00:00
}
2023-07-20 13:40:14 +00:00
let idvalueInput = document.querySelector("#idvalue");
if (idvalueInput != null) {
idvalueInput.addEventListener("change",addResDigitaOrgIdValue);
}
function changeUsername () {
username = document.getElementById("username");
calcCn = document.getElementById("calc-cn");
calcCn.innerText = "Login Name et Courriel seront : " + username.value.split("@")[0] + "@lesgv.com";
}
if (document.getElementById("username") != null) {
document.getElementById("username").addEventListener("change",changeUsername);
}