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.
In reply to how to add progress bar to the CGI script by ashwin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |