Yeni Kod (kısaltılmış ve geliştirilmiştir):
Kod:
<HTML>
<HEAD>
<META name=VI60_defaultClientScript content=JavaScript>
<meta http-equiv="Content-Type" content="text/HTML; charset=windows-1254">
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<META NAME="AUTHOR" Content="Deniz Dursun (Scud)">
<TITLE></TITLE>
</HEAD>
<BODY>
<script LANGUAGE="JavaScript">
<!--
function yarat(secenek){
var secim=secenek;
switch(secim){
case 0:
cocukundivi.innerHTML="";
break;
case 1:
degerler= new Array("MySQL","apache");
textler= new Array("MySQL","apache");
neym="phpcesidi";
break;
case 2:
degerler=new Array("iis","access","mssql");
textler=new Array("iis","access","mssql");
neym="aspcesidi";
break;
case 3:
degerler= new Array("ps","fw");
textler= new Array("Photoshop","fireworks");
neym="grafikcesidi";
break;
}
if(secim!=0){for(i=0;i<degerler.length;i++){
yeniop=document.createElement("OPTION");
yeniop.value=degerler[i];
yeniop.text=textler[i];
cocuk.add(yeniop);
cocuk.name=neym;
}
}
}
function temizle(){
cocukundivi.innerHTML="<SELECT id=cocuk name=\"cesit\"></select>";;
boyut=cocuk.options.length;
for(j=0;j<boyut;j++){
cocuk.remove(cocuk.options[j]);
}
yeniop=document.createElement("OPTION");
yeniop.value="";
yeniop.text="Lütfen Seçiniz";
cocuk.add(yeniop);
}
//-->
</script>
<table border=1><tr><td>
<SELECT id=anne name=anne onchange="temizle();yarat(this.selectedIndex)">
<OPTION selected value="">Lütfen Seçiniz</OPTION>
<OPTION value="PHP">PHP</OPTION>
<OPTION value="ASP">ASP</OPTION>
<OPTION value="grafik">grafik</OPTION>
</SELECT></td><td>
<div id="cocukundivi">
</div></td></tr></table>
</BODY>
</HTML>