Birbirine Bağlı Olarak Değişen Combobox'lar

Javascript kodları Birbirine Bağlı Olarak Değişen Combobox'lar Hazır program kodları hakkında bilgi paylaş; acıklama:Bir combobox'ta bir seçeneği seçiyorsunuz, diğeri ona bağlı olarak değişiyor ...
Cevapla
WebMasTer SiTeSi
 
Seçenekler
  #1  
Arama 27-11-2007, 09:12
egitimbilgisi - ait Kullanıcı Resmi (Avatar)

Üyelik Tarihi: 20/11/07
Mesajlar: 1.759
 
     WS-Ticareti: (3)
Blog Yazıları: 3
Teşekkürleri: 48
375 Msg. 450 Tşkr.
Rep Gücü: 100 egitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant futureegitimbilgisi has a brilliant future

Birbirine Bağlı Olarak Değişen Combobox'lar

acıklama:Bir combobox'ta bir seçeneği seçiyorsunuz, diğeri ona bağlı olarak değişiyor


Kod:
<BODY> 
<!-- Original:  Mikayel Muradyan () --> 
 
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> 
<!-- 
 
// Initialize class for Type and Style 
 
function Type(id, type){ 
 
     this.id = id; 
 
     this.type = type; 
 
} 
 
function Style(id, id_type, style){ 
 
     this.id = id; 
 
     this.id_type = id_type; 
 
     this.style = style; 
 
} 
 
// Initialize Array's Data for Type and Style 
 
TypeArray = new Array( 
 
     new Type(1, "Apparel"), 
 
     new Type(2, "Shoes"), 
 
     new Type(5, "Accessories") 
 
     ); 
 
 
 
StyleArray = new Array( 
 
     new Style(4, 1, "Apparel_1"), 
 
     new Style(7, 1, "Apparel_2"), 
 
     new Style(41, 2, "Shoes_3"), 
 
     new Style(21, 2, "Shoes_4"), 
 
     new Style(17, 2, "Shoes_2"), 
 
     new Style(30, 5, "Accessories_3"), 
 
     new Style(27, 5, "Accessories_4"), 
 
     new Style(31, 5, "Accessories_3") 
 
     ); 
 
 
function init(sel_type, sel_style){ 
 
document.product.id_type.options[0] = new Option("[ Type ]"); 
 
document.product.id_style.options[0] = new Option("[ Style ]"); 
 
for(i = 1; i <= TypeArray.length; i++){ 
 
     document.product.id_type.options[i]     = new Option(TypeArray[i-1].type, TypeArray[i-1].id); 
 
     if(TypeArray[i-1].id == sel_type) 
 
                    document.product.id_type.options[i].selected = true; 
 
} 
 
OnChange(sel_style); 
 
 
 
} 
 
function OnChange(sel_style){ 
 
sel_type_index = document.product.id_type.selectedIndex; 
 
sel_type_value = parseInt(document.product.id_type[sel_type_index].value); 
 
 
for(i = document.product.id_style.length - 1; i > 0; i--) 
 
document.product.id_style.options[i] = null; 
 
 
j=1; 
 
for(i = 1; i <= StyleArray.length; i++){ 
 
if(StyleArray[i-1].id_type == sel_type_value){ 
 
document.product.id_style.options[j] = new Option(StyleArray[i-1].style, StyleArray[i-1].id); 
 
if(StyleArray[i-1].id == sel_style) 
document.product.id_style.options[j].selected = true; 
 
     j++; 
 
     } 
 
} 
 
} 
 
//--> 
 
</SCRIPT> 
 
<form name="product"> 
 
<select name="id_type" size="1" style="width: 150px;" onChange="OnChange()"></select> 
 
<select name="id_style" size="1" style="width: 150px;"></select> 
 
</form> 
 
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"> 
 
<!-- 
 
//init(5, 31); // Initialize comboboxes by selected sel_type and sel_style 
 
init(); // Default initialize comboboxes for Type and Style 
 
//--> 
 
</SCRIPT>
__________________
en güncel blogunuz adan zye hersey bu blogta
Alıntı ile Cevapla
Cevapla
Arama Etiketleri: , , , ,



Seçenekler


Benzer Konular
Konu Konu Açanlar Forum Cevaplar Güncel Mesajlar
msn,de msn ne olarak oturum açıyorum hotmail olarak açamıyorum kenger Webmastersitesi çöplüğü 4 27-02-2008 01:01
dhtml - Değişen içerikler hazırlama 2 B737 Dhtml 0 24-01-2008 01:36
dhtml - Değişen içerikler hazırlama B737 Dhtml 0 24-01-2008 01:36
Forma devamlı değişen şifre verme Celebrian Visual Basic & Action script 0 24-12-2007 12:10
Sayfa Her Yenilendiğinde Değişen Yazı aKaLes Javascript kodları 1 05-10-2007 11:42


Webmaster web tasarım online reviews ~ Kadınlar blogu ~ Apple iPhone, iPod Touch ( iTouch ) Forum ~ iPhone