Connected Combo box problem !please help me
Dear Friends....!
I am developing project in which i have 3 combo :
1) District Selection
2) Taluka Selection
3) Village Selection
Depend on village selection , perticular persons on that village is displayed on the page.
This values must be fetched from DATABASE !
<b> I tried with JAVASCRIPT but with it i can connect two combo and
can't access database inside javascript.WHAT IS THE SOLUTION EXCEPT AJAX ( That i don't KNOW ) </b>
may be i can put 3 combo together and on first OnChange event
i can submit page and process another page and put values in
another combo and forward page to combo page again.
i am very much confused HELP ME !
please i don't know AJAX else problem would be easily solved.
EVEN I CAN"T MANUALLY PUT DATA IN JAVASCRIPT bcoz my villages
are more than 400.
how to put java database code in javascript OnChange event ?
to fetch data of another combo ?
HELP WITH EASY SOLUTION.
Thanks
GHanshyam
================================
SOLUTION FOR TWO COMBO
function populate(o){
d=document.getElementById('de');
if(!d){return;}
var mitems=new Array();
mitems['Choose']=[''];
mitems['Salads']=['Select Item','Tuna Salad','Cesar Salad','Green Salad','Prawn Salad'];
mitems['Main Courses']=['Select Item','Filet Mignon','Porterhouse','Flank','T-Bone'];
mitems['Drinks']=['Select Item','Milkshake','Soda','Mixed Drink','Juice'];
mitems['Desserts']=['Select Item','Ice Cream','Fresh Fruit','Pie'];
mitems['Snacks']=['Select Item','Brownies','Cookies','Potato Chips'];
d.options.length=0;
cur=mitems[o.options[o.selectedIndex].value];
if(!cur){return;}
d.options.length=cur.length;
for(var i=0;i<cur.length;i++){
d.options[i].text=cur[i];
d.options[i].value=cur[i];
}
}
><!-- Pastethis code into the HEAD section of your HTML document.
You may need to change the path of the file. -->
<script type="text/javascript" src="dropdownBox.js"></script>
<!-- Pastethis code into the BODY section of your HTML document -->
<form action="" method="get">
<label for="or">Our menu:</label>
<select name="or" id="or" onchange="populate(this)">
<option value="Choose">Select from the Menu</option>
<option value="Salads">Salads</option>
<option value="Main Courses">Main Courses</option>
<option value="Drinks">Drinks</option>
<option value="Deserts">Deserts</option>
<option value="Snacks">Snacks</option>
</select>
<label for="de">Select:</label>
<select name="de" id="de"></select>
<input type="submit" value="Show me" />
</form>
<div align="center">
</div>

