Display Message When Repeater Search Returns No Results
ATTENTION: THIS IS OUR OLD SITE. TO SEE OUR NEW WEBSITE, CLICK HERE.
The following code will show you how to display a message for your website users when a search or dynamic filters on a repeater returns no results.
This code assumes you have already set up a repeater which can be dynamically filtered or searched in some way. The screenshot below shows an example of the message which is displayed when a repeater displays no results. In this case, the user searched for 'xyz' in the WixCodeBank, and no results were returned.
A function is created called resultsCheck() which determines how many rows are retrieved in the dataset #dbCodeBank. If no results are returned, a text element called #txtNoResults is displayed with a message "Can't find what you are looking for? - please contact us! ..." and the repeater collapsed (visa versa if results are retrieved). The resultsCheck() function should be called when the page loads onReady and within the filter function you are using, after the filtering has been done.