close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Reset Dropdown List in Search Form

Thread began 1/29/2010 7:42 pm by jurinski334466 | Last modified 12/02/2014 9:51 am by jurinski334466 | 2375 views | 7 replies

jurinski334466

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.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...