troubleshooting Question

Timed message box while page loads due to long query

Avatar of dcjsdts
dcjsdts asked on
JavaScriptPHP
6 Comments1 Solution1095 ViewsLast Modified:
Hi folks - here's my situation.  I submit my form which queries 3 databases to build my end result.  Everything works fine and what I currently do is just an ALERT that after clicking the submit button it may take up to 10 seconds to return your result.

What I would like is something for them to see or ead during this approximate 10 second wait.  As soon as they click OK, the queries run and the new results page loads once it receives the reqults from my one query which takes 5 - 10 seconds on a good day.  I'd like to display something for 10 seconds (10 seconds to make it easy) or display an intermediate page or php echoed message until the page does load.

I was thinking I could do a static timed popup using window.onLoad?  But I know there has to be a better way to make this autodismiss once the page populates with data.

Any ideas welcome.  Thanks in advance!!
function OpenForm(rid, tid){
var myRID = rid;
var myFTech = tid;
alert('This may take up to 10 seconds to redirect while the databases are queried.\r\n\nPlease Click Ok to continue.');
window.location="weekly_edit.php?dofunction=edit_form&idno=" + myRID + "&tech=" + myFTech;
}
ASKER CERTIFIED SOLUTION
leakim971
Multitechnician
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros