You are viewing limited content. For full access, please sign in.

Question

Question

Show "Searching..." while loading search form results

asked on September 7, 2016 Show version history

We have WebLink configured to allow public access to publicly available records. I noticed that when I search for something from the search menu tab, I see a “Searching…” icon that shows the system is working:

However, when I perform a search using a search form (from the Welcome page), nothing like that icon appears to indicate that the system is performing the search. Is there a way to add that in for search forms so that users will know that results are in the process of being retrieved?

0 0

Replies

replied on September 7, 2016

Yes, this is possible!

Navigate to the folder that contains WebLink Web Files, which should be in Program Files\Laserfiche\WebLink\Web Files. Find CustomSearch.aspx (and make sure that it's .aspx). Right click and open with a text processing application like Notepad.

Find the line that starts with <body (around line 14) and add the following code in the same line right after <body:

     onload="javascript:SearchLoad()"

Now add the following code in the <body> section before </body>, preferably near the bottom (I put it after the last </div> before </form>):

       <script type="text/javascript">

           (function SearchLoad() {

               var submitButton = $('input[value=Submit]');

               if (submitButton && submitButton.length) {

                   submitButton[0].onclick = function () {

                       // hide 'no results yet'

                       var noSearchRunDiv = document.getElementById('NoSearchRunDiv');

                       if (noSearchRunDiv) {

                           noSearchRunDiv.innerHTML = "";

                       }

                       // display 'Searching...' box

                       var LoadingBox = document.createElement("div");

                       LoadingBox.className = "SearchLoadingBox";

                       var distFromRight = (document.body.clientWidth / 2 - 80); /* center on whole page */

                       LoadingBox.style.right = distFromRight + 'px';

                       var SpinnerIcon = document.createElement("div");

                       SpinnerIcon.className = "SpinnerIconSmall Spin";

                       SpinnerIcon.style.marginRight = "5px";

                       LoadingBox.appendChild(SpinnerIcon);

                       var MessageDiv = document.createElement("div");

                       MessageDiv.style.display = "inline-block";

                       MessageDiv.appendChild(document.createTextNode("<%=m_strings.GetString("STR_RETRIEVING_SEARCH_RESULTS")%>"));

                       LoadingBox.appendChild(MessageDiv);

                       document.body.appendChild(LoadingBox);

                   }

               }

           })();

    </script>

 

And that's it!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.