View Full Version : Inform user he has to wait for some time. Hourglass problem.

marcel claassen
09-13-2008, 07:25 PM
I'm writing a program using php, ajax (xajax library), mysql and html
On a form there is a button where a user can click when a new order should go to the database. Sometimes this lasts a couple of seconds. So I want to inform the user that he has to wait. In the code below this delay is simulated by a pause of 10 seonds. All I get is the message 'done'. Is there a way to instantly refresh the <div> stoplicht before the pause function is called?


function new_order () {
document.getElementById('stoplicht').innerHTML="please wait";
// xajax_new_order(xajax.getFormValues('ThisForm'));
// xajax_orders(xajax.getFormValues('ThisForm'));
return false;

09-15-2008, 12:05 AM
What is the probelm with showing a hidden div with "Processing" and using an gif showing what is happening. So when you make the request you unhide the div. When the request comes back you hide it.

There is no "pause" functionality needed. I am also not sure how you are pausing when JavaScirpt has no concept of threads in that manner.