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; } disableThis(); }); function disableThis() { tableSelectionDomElement.disabled = true; } function RemoveTable() { try { document.getElementById("root").removeChild("tabla_Form"); } catch (error) { console.error(error); } } function CreateTagokForm() { RemoveTable(); let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = `
`; root.appendChild(form); return; } function CreateTagsagForm() { RemoveTable(); let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; } function CreateJelenletForm() { RemoveTable(); let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; } function CreateEsemenyekForm() { RemoveTable(); let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; } function CreateVisszajelzesForm() { RemoveTable(); let form = document.createElement("div"); form.id = "tabla_Form"; form.innerHTML = ` `; root.appendChild(form); return; }