I got 3 input fields and each field are getting their data from its own tables called Tour type, country and destination respectively as shown
<label>Tour Type</label>
<select id="element_11" name="element_11" required>
<option value="" selected="selected">--Select--</option>
<?php
while($row=mysql_fetch_array($sql))
{
$tour_type_id=$row['tour_type_id'];
$name=$row['tour_name'];
echo "<option value='$tour_type_id'>$name</option>";
}
?>
</select>
<label>Country</label>
<select id="element_12" name="element_12" required>
<option value="" selected="selected">-- Select --</option>
<?php
$sql=mysql_query("Select countries_id,countries_name from countries");
while($row=mysql_fetch_array($sql))
{
$cid=$row['countries_id'];
$name=$row['countries_name'];
echo "<option value='$cid'>".$name."</option>";
}
?>
</select>
<label>Destination</label>
<select id="element_13" name="element_13" required>
<option value="" selected="selected">-- Select --</option>
<?php
$sql=mysql_query("Select destination_id,destination_name from destination");
while($row=mysql_fetch_array($sql))
{
$destination_id=$row['destination_id'];
$name=$row['destination_name'];
echo "<option value='$destination_id'>".$name."</option>";
}
?>
</select>
</div>
</li>
This is what i got as my 3 database tables i.e. tourtype, countries and destination respectively:



I am trying to make each field dependent on each other more like a dependent drop down box. For example if i select a tour type then the 2nd drop down should populate options only relevant to what is selected from the 1st drop down and so on. In this case for e.g if i select culture ,then the 2nd drop down should only show amsterdam and belgium.
Can anyone help me on this.