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:
Change top and left in the style to where you want the box to pop up.
Body section:
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.
Head section:
Code:
<script language="javascript" type="text/javascript" src="ua.js"></script>
<script language="javascript1.2" type="text/javascript" src="xbStyle.js"></script>
<script language="javascript1.2" type="text/javascript">
var WorkingElement;
var WorkingStyleObj;
function ShowWorking() {
WorkingElement= document.getElementById('Working');
if ( WorkingElement) {
WorkingStyleObj = new xbStyle(WorkingElement);
tid = window.setInterval("BlinkWorking()", 300);
}
return true;
}
function BlinkWorking() {
if ( WorkingStyleObj.getVisibility() == "hidden" ) {
WorkingStyleObj.setVisibility("visible");
} else {
WorkingStyleObj.setVisibility("hidden");
}
}
</script>
<style type="text/css">
.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>
Body section:
Code:
<DIV id="Working" class="workingClass">WORKING</DIV>
...
<form ... onSubmit="return ShowWorking()">
Tracy Dryden
tracy@bydisn.com
Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.