Örnek uygulama: Js seçiliyse

Açıklama

Seciliyse fonksiyonu bir select nesnesinde belirlediğiniz seçenek seçildiğinde yeni bir select nesnesi oluşturulmasını sağlar.




Örnek Uygulama



Bak buraya gelecek kuzu



Fonksiyon kodları

function seciliyse(bu,anahtar,deger,yeninput,nereye){ var adi=bu.name; var adet=bu.options.length; if(anahtar=='text') var secili=bu.options[bu.selectedIndex].text; else var secili=bu.options[bu.selectedIndex].value; for(var i=0; i<=adet; i++){ if(secili==deger) { i=adet+1; var yeninp = document.createElement('input'); yeninp.setAttribute('name',yeninput); yeninp.setAttribute('id',yeninput); if(varmi=!document.getElementById(yeninput)) document.getElementById(nereye).insertBefore(yeninp,null); } if((i==adet) && (secili!=adet)) { if(document.getElementById(yeninput)) document.getElementById(nereye).removeChild(document.getElementById(yeninput)); } }




Kullanımı için döküman'ı okuyun

                Sürüm: 1.0 | Yazı - Döküman | Uygulama Kodları | yedincisenol.com | o et yedincisenol nokta com