Processing bar example code

When the “search” button is pressed, it shows the “Search processing. Please wait…”

until the browser shows “bestsellers.jsp”.

<div id=”search_simple”>     

<form id=”form1″ name=”form1″ method=”post” action=”bestsellers.jsp”

onsubmit=”showProcessingBar()”>
……
    <button name=”submit” type=”submit”>Search</button>
</form>
</div>

<div id=”processingbar” style=”display:none”>
 <h3><font color=”red”>Search processing. Please wait…</font></h3>
</div>

javascript code:

  function showProcessingBar()
  {
     document.getElementById(“search_simple”).style.display = “none”;

     document.getElementById(“processingbar”).style.display = “block”;

     return true; // you must return true otherwise the form will not be submitted
  }

 

Leave a Reply

Your email address will not be published. Required fields are marked *