IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası

IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası (https://www.ircforumlari.net/)
-   HTML/CSS/JavaScript (https://www.ircforumlari.net/html-css-javascript/)
-   -   Birbirine Bağlı Olarak Değişen Combobox'lar (https://www.ircforumlari.net/html-css-javascript/625432-birbirine-bagli-olarak-degisen-comboboxlar.html)

hAte 10 Ekim 2014 04:02

Birbirine Bağlı Olarak Değişen Combobox'lar
 
PHP- Kodu:

<BODY
<!-- 
OriginalMikayel Muradyan (mikam[MENTION=4110]freenet[/MENTION].am) --> 

<
SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript"
<!-- 

// Initialize class for Type and Style 

function Type(idtype){ 

this.id id

this.type type



function 
Style(idid_typestyle){ 

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(41"Apparel_1"), 

new 
Style(71"Apparel_2"), 

new 
Style(412"Shoes_3"), 

new 
Style(212"Shoes_4"), 

new 
Style(172"Shoes_2"), 

new 
Style(305"Accessories_3"), 

new 
Style(275"Accessories_4"), 

new 
Style(315"Accessories_3"

); 


function 
init(sel_typesel_style){ 

document.product.id_type.options[0] = new Option("[ Type ]"); 

document.product.id_style.options[0] = new Option("[ Style ]"); 

for(
1<= TypeArray.lengthi++){ 

document.product.id_type.options[i] = new Option(TypeArray[i-1].typeTypeArray[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(
document.product.id_style.length 10i--) 

document.product.id_style.options[i] = null


j=1

for(
1<= StyleArray.lengthi++){ 

if(
StyleArray[i-1].id_type == sel_type_value){ 

document.product.id_style.options[j] = new Option(StyleArray[i-1].styleStyleArray[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> 



Tüm Zamanlar GMT +3 Olarak Ayarlanmış. Şuanki Zaman: 11:53.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO
Copyright ©2004 - 2025 IRCForumlari.Net Sparhawk