marcel claassen
09-13-2008, 06: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?
Thanks!
function new_order () {
document.getElementById('stoplicht').innerHTML="please wait";
// xajax_new_order(xajax.getFormValues('ThisForm'));
pause(10000);
document.getElementById('stoplicht').innerHTML="done";
// xajax_orders(xajax.getFormValues('ThisForm'));
return false;
}
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?
Thanks!
function new_order () {
document.getElementById('stoplicht').innerHTML="please wait";
// xajax_new_order(xajax.getFormValues('ThisForm'));
pause(10000);
document.getElementById('stoplicht').innerHTML="done";
// xajax_orders(xajax.getFormValues('ThisForm'));
return false;
}