Hi John,
This code may not be exactly what you need, but hopefully it helps:
<style>
#myImageID {display:none;}/*hide image*/
</style>
<cfform>
<cfinput type="button" name="myButtonID" value="click me" />
</cfform>
<img id="myImageID" src="PleaseWait.gif" alt="Please Wait" />
<script type="text/javascript">
/* <![CDATA[ */
var buttonID = 'myButtonID';
var imageID = 'myImageID';
var submitted = false;
var trigger = document.getElementById(buttonID);
trigger.onclick = function() {
if (!submitted) {
submitted = true;
setTimeout('document.getElementById(imageID).style.display =
"inline"', 100);//delay for IE (help prevent 'frozen' animated gif)
return true;
} else {
return false;//disable 2+ clicks
}
}
/* ]]> */
</script>
Thanks!,
-Aaron Neff
> I have an app which calls a web service on a different computer to do
> work on its behalf and sometimes my users are impatient and hit the
> invocation button a second time, which causes problems. I'd like to
> pop some kind of work-in-progress or busy icon on the web page while
> this service is executing but am drawing a blank on how to do that. I
> can envision a hidden div with some kind of animated gif but am not
> sure of exactly how to activate it and then deactivate it when the
> service returns.
>
> Would appreciate any ideas on how to do this.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333633
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm