ashwin has asked for the wisdom of the Perl Monks concerning the following question:
Hi Everyone,
I have a CGI script that takes input from the enduser, processes the request and shows the output to the user. The script takes a bit long to finish. As of now user can see only the process symbol until the request is completely processed.
To keep the user stick to the same page I'd like to add a progress bar that should let the user know of what's happening at the webserver like what's is the task being done, how long it will take to finish processing the request and showing the progress in a horizontal bar filling with a color gradually ...
I've tried using Javascript, HTML and CGI::ProgressBar perl module to do this. But, these didn't work the way I wanted.
Can you please guide me how to achieve this?
Here is how my script looks like:
-----------------------------------------------------------------------------------------------------------------#!/usr/bin/perl use strict; use warnings; use CGI; require 'myroutines.pl'; # other required routines here ... ... my $cgi = new CGI; my $JSCRIPT=<<EOF; // JS functions to validate user input ... ... EOF print $cgi->header(); print $cgi->start_html(-Title=>'myTitle', -script=>$JSCRIPT); ## code here ## if( $cgi->param('submit') { my $output1 = & subRoutine1(arg1,arg2..); ... ... my $output2 = & subRoutine2(arg1,arg2,arg3..); ... ... ### I've used several subroutines ### showing the output to the user } else { ### code to show form fields the user has to fill in } print $cgi->end_html;
Please let me know if anything needs to be clarified.
Thank you all in advance.
Regards, Ashwin.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to add progress bar to the CGI script
by BioLion (Curate) on Aug 26, 2009 at 16:58 UTC | |
by ashwin (Initiate) on Aug 28, 2009 at 16:41 UTC | |
|
Re: how to add progress bar to the CGI script
by Sewi (Friar) on Aug 26, 2009 at 17:24 UTC | |
by ashwin (Initiate) on Aug 29, 2009 at 09:16 UTC | |
|
Re: how to add progress bar to the CGI script
by Anonymous Monk on Aug 26, 2009 at 16:51 UTC | |
|
Re: how to add progress bar to the CGI script
by leocharre (Priest) on Aug 26, 2009 at 18:28 UTC | |
by ashwin (Initiate) on Aug 29, 2009 at 09:13 UTC |