Hallo,
Kann mir also jemand erklären, wie ich dynamisch eine bestimmte Anzahl an Radiobuttons im Nachhinein!! erzeugen und diese an einer bestimmte Stelle einfügen kann??
Mit den gaengigen DOM-Methoden klappt das unter IE und Mozilla problemlos. Dieses Beispiel erzeugt nach dem Laden des Dokuments drei Radio-Buttons im bereits angelegten Formular mit der id="formular":
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Test by TM 11/02</title>
<script language="JavaScript" type="text/javascript">
<!--
function CreateRadio(anzahl)
{
for(i=0;i<anzahl;i++)
{
feld=document.createElement("input");
feld.setAttribute("type","radio");
feld.setAttribute("name","auswahl"+anzahl);
document.getElementById("formular").appendChild(feld);
}
alert(document.forms[0].elements.length);
}
//-->
</script>
</head>
<body onload="CreateRadio(3)">
<form id="formular" action="">
</form>
</body>
</html>
MfG, Thomas