ok, thats great except for when the page first loads and the user hasn't submitted data, you get an undefined index on 'display' from this line: $display .= "Please select rate type:";
and on 'test' from this line: $selected = ($_POST['test'] == $value) ? ' selected="selected"' : '';
I assume that I will need to use 'isset,' when I tried
[B] if(isset($_POST['submit']))
{ [/B]
$display .= "Please select rate type:";
$display .= '<select size="1" name="hairuptype">';
foreach(array('Approximate Charge', 'Per Hour') as $value)
{
$selected = ($_POST['hairuptype'] == $value) ? ' selected="selected"' : '';
$display .= "<option value='$value'$selected>$value</option>\n";
}
$display .= '</select>';
echo $display;
The problem here was that when the page starts it is not set so the drop down does not appear....
Thanks,
G