Does anyone know how to change the mouse pointer, or cursor when runing some code in an ASP page?
Thanks
Printable View
Does anyone know how to change the mouse pointer, or cursor when runing some code in an ASP page?
Thanks
I'm assuming you mean client side processing?
If not client script, you'll have to cowboy it - open a popup window that will do the processing, cache the execution results, redirect the opener & display the results. Or just accept it that the user has to wait :)Code:<html>
<head>
<script language="javascript" type="text/javascript">
function changeCursor(isBusy) {
document.body.style.cursor = (isBusy == true) ? "hand" : "default";
}
</script>
</head>
<body>
<input type="button" onclick="changeCursor(true);" value="Show Busy">
<input type="button" onclick="changeCursor(false);" value="Back to normal">
</body>
</html>
axion_sa, thanks for the reply.
If I wanted the curosr to be the hour glass, what would I replace "hand" with?
Also, can I change the fore and back colors of this type of button?
Thanks again
Hi again, mabye I should go buy a Java book. lol
Anyway, say I have the following control.
VB Code:
<asp:dropdownlist id="cmbStores" style="Z-INDEX: 112; LEFT: 281px; POSITION: absolute; TOP: 182px" runat="server"></asp:dropdownlist>
Would it be possible for this to use the same java script for an onclick event. I put this line in the above code...
VB Code:
onclick="changeCursor(true);"
But, it caused an error.
Thanks again!
Works for me:
What error are you getting?Code:<asp:DropDownList id="DropDownList1" onclick="changeCursor(true);" runat="server"></asp:DropDownList>
Hmmm, I guess it does work. Threre is a red squigly line under onclick. I assumed that it woudln't run.