Click to See Complete Forum and Search --> : [Resolvd] Mouse Pointer
indydavid32
Nov 25th, 2003, 11:37 AM
Does anyone know how to change the mouse pointer, or cursor when runing some code in an ASP page?
Thanks
axion_sa
Nov 25th, 2003, 12:32 PM
I'm assuming you mean client side processing?
<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>
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 :)
indydavid32
Nov 25th, 2003, 01:15 PM
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
axion_sa
Nov 25th, 2003, 01:26 PM
Valid CSS cursor values (http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/cursor.asp) :)
indydavid32
Nov 25th, 2003, 03:33 PM
Hi again, mabye I should go buy a Java book. lol
Anyway, say I have the following control.
<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...
onclick="changeCursor(true);"
But, it caused an error.
Thanks again!
axion_sa
Nov 26th, 2003, 11:58 AM
Works for me:
<asp:DropDownList id="DropDownList1" onclick="changeCursor(true);" runat="server"></asp:DropDownList>
What error are you getting?
indydavid32
Nov 26th, 2003, 02:22 PM
Hmmm, I guess it does work. Threre is a red squigly line under onclick. I assumed that it woudln't run.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.