I have successfully linked 2 dropdown lists, but then I got greedy and wanted to provide the same information to further dropdown boxes.
What I am trying to do is to select a client and then offer daily shifts dependent on the client selected.
I can only still get the first box (Monday) to subsequently open. Can you see what I am doing wrong and possible come up with a solution.
Code: [php]
// Starting of first drop downlist
echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Client</option>";
while($noticia2 = mysql_fetch_array($quer2)) {
if($noticia2['client_id']==@$cat){echo "<option selected value='$noticia2[client_id]'>$noticia2[client]</option>"."<BR>";}
else{echo "<option value='$noticia2[client_id]'>$noticia2[client]</option>";}
}
echo "</select>";
// This will end the first drop down list
?>
<tr>
<td class="label">Monday :</td>
<td class="field">
<?
echo "<select name='Monday'><option value=''></option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">Tuesday :</td>
<td class="field">
<?
echo "<select name='Tuesday'><option value=''></option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">Wednesday :</td>
<td class="field">
<?
echo "<select name='Wednesday'><option value=''></option>";
while($noticia = mysql_fetch_array($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
// etc .......
[/php]