.







Cenk Yurtseven
 
English Deutsch Türkçe
Home Javascript Library Javascript Library Web Forms Web Forms
 Displaying  2.  of  2  Display: 


 
Simple Ajax Combo Simple Ajax Combo Language:  Javascript 
Simple Ajax Combo for countries and cities

Simple Ajax Combo
 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<
HTML>
<
HEAD>
<TITLE>Iller ve Ilceler</TITLE>
</
HEAD>
<
BODY>
<FORM NAME="otocard">

<SELECT NAME="iller" onChange="getIlceler(document.forms.otocard.iller.options[document.forms.otocard.iller.selectedIndex].value);">
</SELECT>

<SELECT NAME="ilceler">
<OPTION VALUE="0">Ilceler</OPTION>
</SELECT>

</FORM>
<
SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
var illerx = new Array();
illerx[0] = new Array("Iller", "Ilceler");
illerx[1] = new Array("Antalya", "Merkez", "Muratpasa", "Kepez");
illerx[2] = new Array("Ankara", "Ulus", "Kizilay");
illerx[3] = new Array("Istanbul", "Sariyer", "Beyoglu", "Sisli", "Taksim");
for (var j = 0; j < illerx.length; j++)
{
document.forms.otocard.iller.options[j] = new Option(illerx[j][0], j);
}
function getIlceler(selectedIL)
{
var i = 1;
for (i = 1; i < 100; i++)
{
document.forms.otocard.ilceler.options[i] = null;
}
for (i = 1; i < illerx[selectedIL].length; i++)
{
document.forms.otocard.ilceler.options[i] = new Option(illerx[selectedIL][i], i);
}
if (String(selectedIL) == "0")
{
for (i = 0; i < 100; i++)
{
document.forms.otocard.ilceler.options[i] = null;
}
}
}
</
SCRIPT>
</
BODY>
</
HTML>


 Displaying  2.  of  2  Display: 


« Previous  1  2  
Member Login  |  Contact Us