I have two drop down lists one is depended on other if one value selected the other one load same values from database. for example if i select one country other load same cities that country.
<select name="A" class="input_text" id="A">
<?php
include 'config/config.php';
$sql="SELECT * FROM department ORDER BY Dept ASC";
$result=mysql_query($sql);$options="";
while ($row=mysql_fetch_array($result)){
$did=$row["DeptCode"];
$depts=$row["Dept"];
$options.="<OPTION value='$did'>".$depts;}?>
<option value="0">Select...</option>
<?php echo $options; ?>'
</option>
</select>
<select name="B" class="input_text" id="B">
<?php
include 'config/config.php';
$sql="SELECT * FROM department WHERE DeptCode=$dpttitle";
$result=mysql_query($sql);$options="";
while ($row=mysql_fetch_array($result)){
$did=$row["DeptCode"];
$depts=$row["Dept"];
$options.="<OPTION value='$did'>".$depts;}?>
<option value="0">Select...</option>
<?php echo $options; ?>
</option>
</select>
<script type="text/javascript">
A.onblur = function() {
B.value = this.value;};
</script>