First compobox value should control the next compobox in PHP
Posted: Sat Dec 12, 2009 10:10 pm
I have created a compobox and selected District from address table. I have to take the district name as a key and filter "towns" from address table and it should be displayed in the second compobox. Anyone help me what code i can use for second compobox?
The code used for the first one is :
<select name="cate" id="cate" style="width:180px;" >
<option value="select">Select District</option>
<?
$new=mysql_query("select * from address order by district asc");
while ($new12=mysql_fetch_array($new))
{
?>
<option value="<?=$new12['district'];?>"><?=$new12['district'];?></option>
<? } ?>
</select>
The code used for the first one is :
<select name="cate" id="cate" style="width:180px;" >
<option value="select">Select District</option>
<?
$new=mysql_query("select * from address order by district asc");
while ($new12=mysql_fetch_array($new))
{
?>
<option value="<?=$new12['district'];?>"><?=$new12['district'];?></option>
<? } ?>
</select>