Reset Search Criteria

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
starquest321
User
Posts: 140

Reset Search Criteria

Post by starquest321 »

After I conduct a search - the filter stays until I do "show all"
What event do I have to use to do the following:

After do the search .... display the results ....but the next search will not be within the context of what was searched? Meaning:

Search ----> then clear the filter for future searches?


mobhar
User
Posts: 11905

Post by mobhar »

Assume you are using the Advanced Search. Find this code in your generated *srch.php file:

	// Restore search settings from Session
	if ($gsSearchError == "")
		$this->LoadAdvancedSearch();

then simply remove it, and try again.


starquest321
User
Posts: 140

Post by starquest321 »

Excellent but I am using normal search. Can I update template in phpnaker?


mobhar
User
Posts: 11905

Post by mobhar »

Either customizing "list-script.php" template file, or customizing the generated *list.php file, then simply remove this code:

$this->RestoreSearchParms();

and

$this->setSearchWhere($this->SearchWhere); // Save to Session


starquest321
User
Posts: 140

Post by starquest321 »

I want them to make some more advanced:

In search add a button called: "retain search"
If clicked ---> then keep the search parameter values

If not checked go ahead and clear them after displaying the results.

How to add button next to search option. . .


mobhar
User
Posts: 11905

Post by mobhar »

Just try it by yourself first, and post your code for discussion.


starquest321
User
Posts: 140

Post by starquest321 »

I noticed that there are events for searches. Can I use those instead of customizing the template?


danielc
User
Posts: 1599

Post by danielc »

You can use jQuery .val(value) to clear the search value for text box input. See api.jquery.com/val/.


Post Reply