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=\"relo ad(this.form)\" ><option value=''>Client </option>";
while($noticia2 = mysql_fetch_arr ay($quer2)) {
if($noticia2['client_id']==@$cat){echo "<option selected value='$noticia 2[client_id]'>$noticia2[client]</option>"."<BR>" ;}
else{echo "<option value='$noticia 2[client_id]'>$noticia2[client]</option>";}
}
echo "</select>";
// This will end the first drop down list
?>
<tr>
<td class="label">M onday :</td>
<td class="field">
<?
echo "<select name='Monday'>< option value=''></option>";
while($noticia = mysql_fetch_arr ay($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">T uesday :</td>
<td class="field">
<?
echo "<select name='Tuesday'> <option value=''></option>";
while($noticia = mysql_fetch_arr ay($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">W ednesday :</td>
<td class="field">
<?
echo "<select name='Wednesday '><option value=''></option>";
while($noticia = mysql_fetch_arr ay($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
// etc .......
[/php]
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=\"relo ad(this.form)\" ><option value=''>Client </option>";
while($noticia2 = mysql_fetch_arr ay($quer2)) {
if($noticia2['client_id']==@$cat){echo "<option selected value='$noticia 2[client_id]'>$noticia2[client]</option>"."<BR>" ;}
else{echo "<option value='$noticia 2[client_id]'>$noticia2[client]</option>";}
}
echo "</select>";
// This will end the first drop down list
?>
<tr>
<td class="label">M onday :</td>
<td class="field">
<?
echo "<select name='Monday'>< option value=''></option>";
while($noticia = mysql_fetch_arr ay($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">T uesday :</td>
<td class="field">
<?
echo "<select name='Tuesday'> <option value=''></option>";
while($noticia = mysql_fetch_arr ay($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td class="label">W ednesday :</td>
<td class="field">
<?
echo "<select name='Wednesday '><option value=''></option>";
while($noticia = mysql_fetch_arr ay($quer)) {
echo "<option value='$noticia[hours]'>$noticia[hours]</option>";
}
echo "</select>";
// etc .......
[/php]
Comment