waynewnewbie,
Welcome to the boards.
Please note you should place your code between code blocks by using [noparse]
...
[/noparse] BB Codes.
First and foremost - I would like you to look at how to Escape using mysqli_real_escape_string, as the code here:
$query="SELECT * FROM contact_data WHERE agency_num='$chooser'";
Can cause problems as it can be compromised using SQL Injection.
If you want the original drop down (select) box to maintain it's position when posting, do something similar to the following:
<?php while ($row = $chooserResult->fetch_assoc()): ?>
<option value="<?php echo $row['agency_num'];?>" <?php if (!empty($_POST['chooser']) && $row['agency_num'] == $_POST['chooser']) echo 'selected'; ?> ><?php echo $row['agency_name']; ?></option>
<?php endwhile; ?>
To Break it down:
In HTML, to tell the browser which item is selected you use it like:
<option value="big.nerd" selected="selected">Big Nerd</option>
What we are doing here is saying "If the agency number has been posted, let's see if it is the same number as the one currently being listed, if it is, let's call this selected".
.. One important thing, I may have an error in the code since I kind of rushed this.. so, work through it, you get the idea.
MOD EDIT: Using [noparse]
or [code=html] tags, when appropriate, are preferable over the generic [code] tags due to the syntax highlighting.[/noparse] ;)