@resdigita in javascript

This commit is contained in:
Chris Mann 2023-07-17 13:09:53 +02:00
parent 13b2bbffdd
commit 2c5bb1ebd6

View file

@ -1,8 +1,12 @@
function addResDigitaOrgIdValue () { function addResDigitaOrg (id) {
inputTextEl = document.getElementById("idvalue"); document.getElementById(id).value = document.getElementById(id).value.split("@")[0] + "@resdigita.org";
value = inputTextEl.value; return document.getElementById(id).value;
value = value.split("@")[0];
inputTextEl.value = value + "@resdigita.org";
return value;
} }
document.getElementById("idvalue").addEventListener("change",addResDigitaOrgIdValue()); function addResDigitaOrgIdValue () {
document.getElementById("mail").value = addResDigitaOrg("idvalue");
}
function addResDigitaOrgMail () {
document.getElementById("idvalue").value = addResDigitaOrg("mail");
}
document.getElementById("mail").addEventListener("change",addResDigitaOrgMail);
document.getElementById("idvalue").addEventListener("change",addResDigitaOrgIdValue);