Refering to an earlier post of mine regarding populating drop-down lists according to what was selected in a previous one, it was suggested I use javascript to populate arrays and then use these to populate the drop-down lists.
It is not practical for me to do this, one reason being that the four lists I'm using would be populated from 4 different tables which are updated quite frequently.
So I've decided to reload the page (which is mostly text so it shouldn't take too long) after each of the first three selections. The problem I'm having now is that when I reload the page, php doesn't seem to see what was selected! It is probably something really stupid but I just can't see it.
What I've got is two forms on the page. The first contains the four '<select>...</select>' elements and an image being used as the submit button. The form tab looks like this:
<form style="margin-bottom:0;" name="fruitspec" action="<? echo $PHP_SELF ?>?action='fruitspec'" method=post>
The 1st drop down list is populated (this works as I get all the correct options):
...db connection etc...
while( $row1 = mysql_fetch_array( $res1 ))
{
$code = $row1[0];
$desc = $row1[1];
$option_block .= "<option value = \"$code\">$code - $desc</option>";
}
?>
<select name="commgrp"><? echo $option_block ?></select>
The submit button is as follows:
<input type="image" src="../images/buttons/accept_MOff.gif" border=0 width=38 height=10 alt="Accept">
The rest of the document then consists of another form used to capture the rest of the data.
When the page reloads, '$commgrp' is blank. I'm stumped! Does php not like multiple forms?? I had started out using nested forms which gave similar results.
Any suggestions or tips would be GREATLY appreciated.
Thanks
Ted