You are correct and I had since fixed this
So the question really is where can I best trap the last list item selection before the search takes place.
The problem is that $status is null before reaching the loop:
$status = trim($_POST['S_status']);
.
.
.
$status_array = array("", "New Call", "IR in Progress", "Requires Follow-up", "Quote", "Complete", "Closed");
for($i=0;$i<count($status_array);$i++)
{
if($status == $status_array[$i]){ $selected = "selected"; }
$option_status .= "<option value=\"$status_array[$i]\" $selected>$status_array[$i]</option>\n";
$selected = "";
}
so the "" select item is always being marked as selected. $status should have retained the last entered value, then set selected to that list item.
$option_status keeps being set to the following in this loop:
<option value="" selected></option>
<option value="New Call" >New Call</option>
<option value="IR in Progress" >IR in Progress</option>
<option value="Requires Follow-up" >Requires Follow-up</option>
<option value="Quote" >Quote</option>
<option value="Complete" >Complete</option>
<option value="Closed" >Closed</option>