Hey Daniel:
You're not going to believe this but I figured out how to get the drop-down to default to the last agent entered! It's no doubt a horrible adulteration of the php language but it works...
I had to change both forms to POST instead of GET, then I added this to the action file of the second form...
Code:
if($_POST['agent'] == 'DD'){
header("Location: /admin/php/client-history-add.php?agent=DD");
} elseif($_POST['agent'] == 'JV'){
header("Location: /admin/php/client-history-add.php?agent=JV");
} else {
header("Location: /admin/php/client-history-add.php?agent=HS");
}
Then I put this at the top of the form file...
Code:
<?php if(isset($_GET['agent']) && $_GET['agent'] == "DD"){ $ddsel = " selected";
} elseif(isset($_GET['agent']) && $_GET['agent'] == "JV"){ $jvsel = " selected";
} elseif(isset($_GET['agent']) && $_GET['agent'] == "HS"){ $hssel = " selected"; }
?>
And this in the form...
Code:
<select name="agent">
<option value="JV"<?php echo $jvsel;?>>Joanne</option>
<option value="DD"<?php echo $ddsel;?>>Debbie</option>
<option value="HS"<?php echo $hssel;?>>House</option>
</select></p>
And that's it! Works like a charm. It came to me while I was running. Feel free to tell me what's wrong about it. Thanks, e
Bookmarks