[FX.php List] Displaying Progess Bar - Revised

Steve Winter steve at bluecrocodile.co.nz
Sun Jan 27 13:15:11 MST 2008


Hi Jonathan...

Nope, far from impossible if AJAX is an option... ;-) AJAX is your friend,
and although he can be a little hard to get to know, a very good friend to
have in the long run...

Here's a quick rundown on how to do it an AJAX way...

1. Create a div in your main page which has an opacity to it, give it a
z-index greater than the highest z-index element on your page, and set it's
display properties to none.
2. Create another div, which has a z-index 1 higher than the above 'mask'.
Position an animated 'Loading' .gif file in the middle of that. Set display
to none for that too.
3. Create you page. Have your content inside a div with specified id.
4. Set an onsubmit="return false(); doSubmit();" on the form in your page.
The return false stops the page from being submitted on Javascript aware
browsers (but allows those that don't speak JavaScript to submit the form as
usual)
5. have the function doSubmit()
	1. set the size of the mask div to be full screen, and its display
properties to block
	2. set the position of the animation div to the centre of the
screen, and display to block.
	3. use AJAX to submit the content of the form to your processing
script.
6. Add a small script to the end of your processing page, which sets the
display of the mask and the animation back to none.

If you use a 'helper' like prototype.js, then the AJAX stuff is dead easy,
as it provides nice function calls of the type Ajax.Updater('div', 'file',
'parameters');

I can send you a quick demo file tomorrow if you're interested...

Cheers
Steve

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Jonathan Schwartz
Sent: Sunday, 27 January 2008 8:01 p.m.
To: FX.php Discussion List
Subject: [FX.php List] Displaying Progess Bar - Revised

Hi Folks,

After a bunch of research, I've figured out that a progress bar is 
near impossible to do...even with javascript and AJAX.

I'll settle for a screen with ANY INDICATOR OR MESSAGE at all while 
the script runs.  Presently, if I run the script from the current 
page, it just shows the current page.  If I run the script from its 
own page, the page remains blank until the script is completed.

All I want is to be able to display a message, "Please wait while 
processing your request...."

I've been down this path before but gave up.  This time, it is really 
needed during the 15 second processing time of the script I developed 
this week.

If I'm approaching this wrong, please let me know.

Thanks,

Jonathan
-- 
Jonathan Schwartz
Exit 445 Group
jonathan at exit445.com
http://www.exit445.com
415-381-1852
_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list

No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 25/01/2008
7:44 p.m.
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.11/1244 - Release Date: 25/01/2008
7:44 p.m.
 




More information about the FX.php_List mailing list