PDA

View Full Version : Getting rid of the "no results found" message


djogrady376174
01-17-2010, 05:54 PM
Search for Boss works great. The only thing I don't like is that, when I put the search box and the results on the same web page, the "no results found" message appears under the search box when the search page is first opened. Is there a way to get rid of the "no results found" message in this situation?

PS: I use several Webassist products and think they're great. The support forum is also extremely helpful. Thanks.

amused2death
01-17-2010, 08:39 PM
The search is working perfectly, but when someone comes to the page with my search box for the first time they see "No results found matching your search". Once someone searches it goes away unless there are no results.

Any help to have this No results found matching your search hidden on the initial search page load would be extremely grateful.

Thanks.

Office Guy-172461
01-18-2010, 06:33 AM
The support hours are in Pacific Standard Time, WA support will be back in about 3 more hours.

BTW it is considered bad practice to answer privately because it denies others in the forum the benefit of the answer. You can subscribe to the thread if you want an email notification.

Jason Byrnes
01-18-2010, 01:14 PM
The code that produces the no results error message looks like:

<?php
if ("".($Search1_BOSS_all) ."" == "0") { // WebAssist Show If
?>
<div>No results found matching your search.</div>
<?php
} // ("".($Search1_BOSS_all) ."" == "0")
?>


assuming your search from uses the POST method, you could change that to:

<?php if($_SERVER["REQUEST_METHOD"] == "POST") { ?>
<?php
if ("".($Search1_BOSS_all) ."" == "0") { // WebAssist Show If
?>
<div>No results found matching your search.</div>
<?php
} // ("".($Search1_BOSS_all) ."" == "0")
?>
<?php } ?>


to hide the error on initial page load.

djogrady376174
01-18-2010, 09:47 PM
Perfect! That did the job.
Thank you Jason.