www.webdeveloper.com
Results 1 to 4 of 4

Thread: "Please Wait.. Processing.. " Window

  1. #1
    Join Date
    Sep 2003
    Posts
    48

    "Please Wait.. Processing.. " Window

    My application is in PHP.
    I have a payment form where shipping is being calculated through AJAX when the user clicks on "Calculate Shipping" Button. The trouble is sometimes there is a time delay before the Servers Send back the info to the Browser.

    Meanwhile I'd like to display a "Processing.. Please wait" notification to the User.

    Something alone these lines...
    https://plesk8.1win.demo.swsoft.com:8443/login.php3 (Here the Window displays when the page is laoding / when it is refreshed.. )

    How is this done ?
    Is this done with Javascript? Are there any ready made scripts for this ?
    The window should disappear once the user gets his shipping options.


    Thanks!

  2. #2
    Join Date
    Jul 2007
    Posts
    1
    You are going to use javascript to achieve this - but with libraries it shouldn't be too difficult. What library are you currently using (if any) to do the ajax calls?

    From my research it appears like Yahoo's YUI library is one of the best. They have something called a 'Panel' which allows you to easily define options, of how it looks like. The panel has 'show' and 'hide' methods, so all you need to do is call the 'show' right before and ajax call, then the 'hide' once you get the response. Inside the panel, you can have text, html, images, whatever you want.

    I found a page which has a nice tutorial on how to create this here:
    http://javascript.codeislogic.com/aj...rlay-with-yui/

  3. #3
    Join Date
    Sep 2003
    Posts
    48
    Sorry Couldn't reply any earlier.

    I am using HTML_AJAX (PEAR library) to make AJAX calls and fill in the REquired info in the repective DIV's in my Page.

    My guess is HTML_AJAX may also have a customisable entity for such a window. But as I am not able to find it, I will have to come up something else.

    I really dont want to dwell into another Set of utilities like Yahoo's at this point.

    From some analysis I found that this is a simple "DIV" .. Show n Hide and adjusting the z-index so that it stays on top.

    Google gave me a script.. that does exactly this.
    http://javascript.internet.com/text-...t-message.html

    But Doesnt work properly for me. In IE, I have to scroll up to see the 'Please wait' window as my page is pretty long.
    In Firefox, it doesnt even show up.

    How do I make sure that the "Please wait..DIV" stays on Top of the Page and just about in the middle of my screen.. ?

    Thanks in advance.

  4. #4
    Join Date
    Sep 2003
    Posts
    48
    Found my error.

    Earlier my JS code was something like this..
    // Set 'Please wait' window visibility to Visible
    // Call HTML_AJAX() Function here.
    // Set 'Please wait' window visibility to Hidden

    Somehow, the window was opened and closed, though the PHP script that my HTML_AJAX() fucntion calls, had not brought down the results.

    Now.. I changed my JS code to
    // Set 'Please wait' window visibility to Visible
    // Call HTML_AJAX() Function here.

    In the end of my PHP SCript, which HTML_AJAX calls, I placed this JS CODE,
    // Set 'Please wait' window visibility to Hidden

    It works perfectly.. now.. The window pops up and stays till the script delivers the results and then vanishes.

    Also, to Position the DIV correctly , I just placed the DIV code in the FORM where I wanted it and just increased the z-index number.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles