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

How to display a message until records are retrieved? 1

Status
Not open for further replies.

JohnBeals

Programmer
Feb 26, 2002
49
US
I have a stored procedure that takes 10 - 15 seconds to run. I need to display a "Please wait" message until the records are returned. Then the "Please wait" message is replaced by the records returned.

Any suggestions?

Thanks,
JB

 
i didn't try but you could use dhtml to do it ..
use <cfflush> to send your dhtml layer.. and then just set the visibility to &quot;hidden&quot; when the query is completed
 
I have done this with many sites and the only thing I have found to work well is JavaScript. Let me know if you need some code I can send you an example.
 
Hi Wes98765,

I was wondering if you could post the code so that I can also see the example. I have been trying to do this and I just cannot get it to work correctly.

Thanks

Mario
 
Hey Mario, I usually run a animated gif or flash during an insert or an update section in a site before going to the next page. I am not sure if that will work for you. You want to be able to show the animation while the page loads then show the results right? Let me see if I can modify some of my code to fit your problem better.

Wes
 
Just an off the wall thought here..

An IFRAME could work...

Get the results from the submitted page and pass them to the IFRAME src via url...

Then your page could appear instantly with a please wait message.. Did I help?
Vote!
 
that's one of the simpliest solution i found and it works in almost all browser (including IE, NS4+, NS6)
<html>
<body>

<div id=&quot;loading&quot; style=&quot;position:absolute;top:100px;left:300px;&quot;>
<!--- Your waiting text or image goes here --->
LOADING PLEASE WAIT...
</div>

<!--- this will send the <div> to the client side before the begining of the queries --->
<cfflush>

<!--- Your big queries go here --->



<!--- finally, just hide the <div> layer --->
<script>
if (document.all)
document.all.loading.style.visibility = &quot;hidden&quot;;
else if (document.getElementById)
document.getElementById(&quot;loading&quot;).style.visibility = &quot;hidden&quot;;
else
document[&quot;loading&quot;].visibility = &quot;hidden&quot;;
</script>
</body>
</html>
 
[tt]
Try this:


<%
Option Explicit

Response.Buffer=False
Dim myTime, tTime
%>
<html>
<head>
<script language=&quot;JavaScript&quot;>
<!--
function hide_loading(){
var elem = document.getElementById(&quot;loadmsg&quot;);
elem.style.display = &quot;none&quot;;
}
//-->
</script>
</head>
<body onLoad=&quot;hide_loading();&quot;>
<div id=&quot;loadmsg&quot; style=&quot;position:absolute;top:300px;left:300px;width:200px;color:#aaaaff;font-size:40;&quot;>
Loading!!!
</div>
<%
myTime = DateAdd(&quot;s&quot;,10,now)
Do While now < myTime
'this is looping for ten seconds
Loop
%>
</body>
</html>
[tt]
[sup]&quot;Beware of the most dangerous person in business - the articulate incompetent.&quot;[/sup]
[/tt]

banana.gif
rockband.gif
banana.gif

 
&quot;<% / %>&quot;

those are evil...we don't take kindly to their kind 'round these parts...

:) :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top