You are here:  » "Search In Progress" page?

Support Forum



"Search In Progress" page?

Submitted by chrisjpopp on Wed, 2011-06-08 04:13 in

Client is saying they'd like a "We're looking up your request" page for when the search is happening on their site. (Think Orbitz or Priceline when you enter a destination and hit "search" and you get a screen that says "Please wait")

Is this something that can be done with PT? If so, can someone point me to a forum post if there is one? I tried to search for this but if I don't know the correct terminology...

Thanks,
Chris

Submitted by support on Wed, 2011-06-08 10:35

Hello Chris,

One way to do this would be to display a DIV using DHTML on the submit event of the search form. To try this, look for the following code at line 2 of html/searchform.php:

  <form name='search' action='<?php print $config_baseHREF ?>search.php'>

...and REPLACE with:

  <?php
    $searchingHTML = "<div id='searching2' style='position:absolute; background-color:#CCC; width:300px;padding:100px;border:1px solid #000;text-align:center;'>Search in progress<br /><br />Please wait...</div>";
  ?>
  <script type='text/javascript'>
  function search_onsubmit()
  {
    document.getElementById("searching1").innerHTML = "<?php print $searchingHTML?>";
    var searching2 = document.getElementById("searching2");
    searching2.style.left = ((window.innerWidth / 2) - 250) + "px";
    searching2.style.top = ((window.innerHeight / 2) - 200) + "px";
    return true;
  }
  </script>
  <span id='searching1'></span>
  <form name='search' onsubmit='return search_onsubmit()' action='<?php print $config_baseHREF ?>search.php'>

Simply change the HTML within the $searchingHTML variable to contain whatever you wish to display (perhaps including a logo for example).

Hope this helps!

Cheers,
David.
--
PriceTapestry.com