Thanks for your reply.
The search form works great for searching the data; however, I also need to have either a link or a button which clears the search and shows all the results and resets the dropdown list to its default value.
I'm sorry, but I'm not sure what the trigger for the search/results page is called. Where in the code do I find that value?
Right now, I am trying to clear the search using this link added to the form:
<a href="endtime-results.php?clear=true"><em>ResetSearch</em></a>
And this code at the top of the page:
<?php
if(!session_id()) session_start();
if(isset($_SESSION["WADbSearch1_endtimeresults"]) && isset($_GET['clear']) && $_GET['clear'] == "true") {
unset($_SESSION["WADbSearch1_endtimeresults"]);
}
?>
This link works to clear all the search results but does not clear the dropdown list. Instead, the dropdown list returns to the first recordset value of 11:00 am and not the default value of "Search Ending Times."
This is the code for the dropdown list:
<select name="S_EndTime" id="S_EndTime">
<option value="" <?php if (!(strcmp("", $row_WADAendtimelist["EndTime"]))) {echo "selected=\"selected\"";} ?>>Search Ending Times</option>
<?php
do {
?>
<option value="" <?php if (!(strcmp("", $row_WADAendtimelist["EndTime"]))) {echo "selected=\"selected\"";} ?>>Search Ending Times</option>
<?php
do {
?>
<option value="<?php echo $row_WADADynListendtimelist['EndTime']?>"<?php if (!(strcmp($row_WADADynListendtimelist['EndTimeListID'], $row_WADAendtimelist["EndTimeListID"]))) {echo "selected=\"selected\"";} ?>><?php echo $row_WADADynListendtimelist['EndingTime'] ?></option>
<?php
} while ($row_WADADynListendtimelist = mysql_fetch_assoc($WADADynListendtimelist));
$rows = mysql_num_rows($WADADynListendtimelist);
if($rows > 0) {
mysql_data_seek($WADADynListendtimelist, 0);
$row_WADADynListendtimelist = mysql_fetch_assoc($WADADynListendtimelist);
}
?>
</select>
I would appreciate help figuring out how to completely clear the search. Thank you.