Solved

Change mouse pointer to hourglass when executing a vbscript

Posted on 2010-09-19
13
2,451 Views
Last Modified: 2013-11-15
I have an HTML file that executes a vbscript file onclick of a button. I would like to change the mouse pointer to hourglass wheile the script is executing and then return to normal. In the script I have included the statement document.body.style.cursor="hourglass" at the beginning and set to normal just before the End Sub ,  
This does not work at all. There are no errors but mouse pointer will not change .
0
Comment
Question by:caliea
  • 7
  • 6
13 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 33711572
It should be

document.body.style.cursor = "wait"
0
 

Author Comment

by:caliea
ID: 33711583
Thanks tried that , but mouse pointer still stays the same. actually the pointer stays as a hand instead of hourglass
0
 
LVL 58

Expert Comment

by:amit_g
ID: 33711838
Show us the code. Do you have this online? Also, since you are using VBScript, please confirm that you are using IE. Is this over http or you using the local file system?
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:caliea
ID: 33712430
Yes I am using IE . Attached is part of the code. This is not yet online.
mainfile.html
...
<script><src="getdata.vbs" type="vbscript"></script>
...
,...
<input type="button" onclick="vbscript:getdata">

and file getdata.vbs is as :
Sub getdata()
document.body.style.cursor = "wait"
mydiv.innerhtml =" Number of records returned are " & ctr
.....
document.body.style.cursor = "normal"
End sub

mainfile.html is a form that accepts user input as to what the data is required by user and
the vbs file reads the database and returns records and the data .
What happens is that the data returned sometimes takes a while which is why we need to change the mouse pointer to hourglass, thanks
Please let me know if you need additional information
0
 

Author Comment

by:caliea
ID: 33712467
I am doing client side validation
0
 
LVL 58

Expert Comment

by:amit_g
ID: 33712801
<script><src="getdata.vbs" type="vbscript"></script>
...
,...
<input type="button" onclick="vbscript:getdata">

should be

<script src="getdata.vbs" type="vbscript"></script>
...
,...
<input type="button" onclick="getdata">
0
 

Author Comment

by:caliea
ID: 33713074
Hi I did update that, but the mouse pointer is still the same .
0
 
LVL 58

Expert Comment

by:amit_g
ID: 33727430
Is the script being executed? Are you getting the message "Number of records returned are" displayed on the screen?
0
 

Author Comment

by:caliea
ID: 33733620

Yes  actually we added the response=flush statement after the document.body.style.cursor="wait" statement. Now the mouse pointer changes shape correctly, but the script does not execute and it simply goes into a hang state.

Earlier the script executed correctly,
0
 
LVL 58

Expert Comment

by:amit_g
ID: 33735695
It looks like something is being mixed up in the server side and the client side. What is used on the server side? Could you please explain the complete flow of this page?
0
 

Author Comment

by:caliea
ID: 33736903

Client side uses HTML and vbscript to connect to the main database server. We are using OTA COM API which is used by Mercury Quality Center tool to connect to Quality center on the Server. Client html file executes a vbscript locally that establishes a connection with the QC instance. This is turn sends the request to the main DB server and returns data that is then displayed on the html page.

Flow is as :  Client HTML -> vbscript -> execute vbscript locally and establish a connection with QC on server -> returns data to variables in vbscript -> variables are then displayed on HTML div containers.
0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 33750853
Can't say what is going on but the code you have would work just fine. You can test it on a stand alone html and run it in IE and it would work fine.
0
 

Author Closing Comment

by:caliea
ID: 33769236
Thanks for your help,
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows 10 4 59
How to restrict a file from copy/edit/save/print/saveas? 8 71
Scripting vs. Programming languages 25 166
wireless name in LAN adapter 14 50
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
Video by: Tony
This video teaches viewers how to export a project from Adobe Premiere Pro and the various file types involved.
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question