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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

showing clock or hourglass while waiting

Status
Not open for further replies.

apple17

Programmer
Jul 5, 2005
46
0
0
US
I have a page that does a lot of calculation and I'd like to show an animated clock or hourglass while the user is waiting. Can someone point me to a script that I can use / modify?

Thanks!
 
What you need to do is
Code:
style="cursor:wait;"
on the whole form. Here is a simplified form of what you're asking for. I'll leave you to write the bit that goes through all the children setting the cursor to wait when you want the hourglass and default when you don't.
Code:
<html>
<head>
<title>Change Cursor</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<script language="vbscript">
sub waiton_OnClick
   dim objDiv
   set objDiv = document.getElementById ("waiter")
   objDiv.style.cursor = "wait"
   
   ' Need to go through all the children too but
   ' we will just do the on button
   set objDiv = document.getElementById ("waiton")
   objDiv.style.cursor = "wait"   
end sub

sub waitoff_OnClick
   dim objDiv
   set objDiv = document.getElementById ("waiter")
   objDiv.style.cursor = "default"

   ' Need to go through all the children too but
   ' we will just do the on button
   set objDiv = document.getElementById ("waiton")
   objDiv.style.cursor = "default"   
end sub
</script>
</head>

<body id="waiter">
<p>Some text</p>
<p>Talk to me <input id=Text1 type=text></p>
<p>
<input type="button" name="waiton" value="Wait on">
<input type="button" name="waitoff" value="Wait off"> 
</p>
</body>
</html>
 
Note that the code only shows the hourglass - it does not disable any of the buttons. You also need to do that if you don't want the user to click on anything during computation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top