Hi folks
Ok I have two drop down tables both are pulling from an
mysql database. Now what I want to do is this, when you
select an option in dropdown one it will determine whether
dropdown 2 or 3 is displayed
eg if secondary_exam_id == 1 then see dropdown 2
but if secondary_exam_id == 2 then dropdown 3 is displayed
Here is the code
// DROP DOWN 1
echo'<table align="center">';
echo'<tr>
<td colspan="2" class="labelcell"><label for="secondary_exam_id">Select Exam:</label></td>';
echo'<td colspan="2" class="fieldcell2">
<select name="secondary_exam_id">';
$query_result = mysql_query ('SELECT * FROM secondary_exam_type ORDER BY secondary_exam_id');
while ($row = mysql_fetch_array ($query_result, MYSQL_NUM))
{
echo "<option value=\"$row[0]\">$row[1]</option>\n";
}
echo'</select></td>';
echo'</tr>';
// DROP DOWN 2
echo'<tr>
<td colspan="2" class="labelcell"><label for="junior_subject_id">Select Subject:</label></td>';
echo'<td colspan="2" class="fieldcell2"><select name="junior_subject_id">';
$query_result = mysql_query ('SELECT * FROM junior_subjects ORDER BY junior_subject_id');
while ($row = mysql_fetch_array ($query_result, MYSQL_NUM))
{
echo "<option value=\"$row[0]\">$row[1]</option>\n";
}
echo'</select></td>';
echo'</tr>';
// DROP DOWN 3
echo'<tr>
<td colspan="2" class="labelcell"><label for="leaving_subject_id">Select Subject:</label></td>';
echo'<td colspan="2" class="fieldcell2"><select name="leaving_subject_id">';
$query_result = mysql_query ('SELECT * FROM leaving_subjects ORDER BY leaving_subject_id');
while ($row = mysql_fetch_array ($query_result, MYSQL_NUM))
{
echo "<option value=\"$row[0]\">$row[1]</option>\n";
}
echo'</select></td>';
echo'</tr>';
Hope u understand what i'm getting at.
Tks alot
Gaz
Ok I have two drop down tables both are pulling from an
mysql database. Now what I want to do is this, when you
select an option in dropdown one it will determine whether
dropdown 2 or 3 is displayed
eg if secondary_exam_id == 1 then see dropdown 2
but if secondary_exam_id == 2 then dropdown 3 is displayed
Here is the code
// DROP DOWN 1
echo'<table align="center">';
echo'<tr>
<td colspan="2" class="labelcell"><label for="secondary_exam_id">Select Exam:</label></td>';
echo'<td colspan="2" class="fieldcell2">
<select name="secondary_exam_id">';
$query_result = mysql_query ('SELECT * FROM secondary_exam_type ORDER BY secondary_exam_id');
while ($row = mysql_fetch_array ($query_result, MYSQL_NUM))
{
echo "<option value=\"$row[0]\">$row[1]</option>\n";
}
echo'</select></td>';
echo'</tr>';
// DROP DOWN 2
echo'<tr>
<td colspan="2" class="labelcell"><label for="junior_subject_id">Select Subject:</label></td>';
echo'<td colspan="2" class="fieldcell2"><select name="junior_subject_id">';
$query_result = mysql_query ('SELECT * FROM junior_subjects ORDER BY junior_subject_id');
while ($row = mysql_fetch_array ($query_result, MYSQL_NUM))
{
echo "<option value=\"$row[0]\">$row[1]</option>\n";
}
echo'</select></td>';
echo'</tr>';
// DROP DOWN 3
echo'<tr>
<td colspan="2" class="labelcell"><label for="leaving_subject_id">Select Subject:</label></td>';
echo'<td colspan="2" class="fieldcell2"><select name="leaving_subject_id">';
$query_result = mysql_query ('SELECT * FROM leaving_subjects ORDER BY leaving_subject_id');
while ($row = mysql_fetch_array ($query_result, MYSQL_NUM))
{
echo "<option value=\"$row[0]\">$row[1]</option>\n";
}
echo'</select></td>';
echo'</tr>';
Hope u understand what i'm getting at.
Tks alot
Gaz