Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WORKING "popup" 1

Status
Not open for further replies.

tsdragon

Programmer
Dec 18, 2000
5,133
US
Need to pop up a WORKING message to let people know that something is going on while a form is processing? Here's a solution that works on both IE and NS. It uses the browser sniffer code and cross-browser style api from Netscape's Developer's Edge website, so you'll have to download those first (see Thread215-152604 and Thread215-152607). Using the style api made making the code cross-browser compatible REALLY simple.

Head section:
Code:
<script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;ua.js&quot;></script>
<script language=&quot;javascript1.2&quot; type=&quot;text/javascript&quot; src=&quot;xbStyle.js&quot;></script>
<script language=&quot;javascript1.2&quot; type=&quot;text/javascript&quot;>
var WorkingElement;
var WorkingStyleObj;
function ShowWorking() {
   WorkingElement= document.getElementById('Working');
   if ( WorkingElement) {
      WorkingStyleObj = new xbStyle(WorkingElement);
      tid = window.setInterval(&quot;BlinkWorking()&quot;, 300);
   }
   return true;
}
function BlinkWorking() {
   if ( WorkingStyleObj.getVisibility() == &quot;hidden&quot; ) {
      WorkingStyleObj.setVisibility(&quot;visible&quot;);
   } else {
      WorkingStyleObj.setVisibility(&quot;hidden&quot;);
   }
}
</script>
<style type=&quot;text/css&quot;>
.workingClass { position:absolute; top:100px; left:100px; padding:10px; color:white; background-color:red; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:18pt; font-weight:bold; visibility:hidden; }
</style>
Change top and left in the style to where you want the box to pop up.

Body section:
Code:
<DIV id=&quot;Working&quot; class=&quot;workingClass&quot;>WORKING</DIV>
...
<form ... onSubmit=&quot;return ShowWorking()&quot;>
If you already have an onSubmit function, just include the call to the ShowWorking function before that function returns.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Thank you very much !! I've been looking for something just like that, that will work on both browsers.

I was chaning the value of the Submit button from &quot;Submit&quot; to &quot;Please Wait&quot; just before the form submitted. It's not pretty, but it was better than nothing.

I really like the method you posted here much better.

ToddWW :)
 
BTW, it's a red (frameless) box with white letters that say &quot;WORKING&quot; in 18pt type. The box alternately hides and shows every 300ms. It's VERY easy to customize it to do or say whatever you need. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top