const root = document.getElementById("root"); let tableSelectionDomElement = document.getElementById("tabla"); let selectedTable = "tagok"; tableSelectionDomElement.addEventListener("change", function (){ selectedTable = tableSelectionDomElement.value; switch (selectedTable) { case "tagok": CreateTagokForm(); break; case "tagsag": CreateTagsagForm(); break; case "jelenlet": CreateJelenletForm(); break; case "esemenyek": CreateEsemenyekForm(); break; case "visszajelzes": CreateVisszajelzesForm(); break; default: break; } }); function RemoveTable(){ if (document.getElementById("tabla_Form") != null){ root.removeChild("tabla_Form"); console.log("asd"); } return; } function CreateTagokForm(){ RemoveTable(); //TODO fix names in the form let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = `
`; root.appendChild(form); return; } function CreateTagsagForm() { RemoveTable(); //TODO fix names in the form let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; } function CreateJelenletForm(){ RemoveTable(); //TODO fix names in the form let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; } function CreateEsemenyekForm(){ RemoveTable(); //TODO fix names in the form let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; } function CreateVisszajelzesForm(){ RemoveTable(); //TODO fix names in the form let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; }