Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Inform user he has to wait for some time. Hourglass problem.

    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;
    }

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    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.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •