Avatar of SiemensSEN
SiemensSEN
 asked on

how to show progress bar

Hello,

I have web page that submit some information to the server (postback the page). On the server, I  launch an external program to do some processing (async) and return to current page. The external  does some work and write the percent complete and action to a file.  I would like the  user to be inform of the process. So, when user return to the current page again , I would like to show a status bar with progress.and keep then on on the page until  job is complete
----
 When the user return to the page  how do I show the progress bar..Do I have re-direct to another page and show the status  ? or can I show a modal dialog with a progress bar in the current page (not sure how to do this action)

[php, jquery]

Thanks for the help
jQueryAJAXPHP

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Julian Hansen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SiemensSEN

ASKER
Thanks you  for the answer and the sample code. However, I  need your advise on how to do the navigation.

The user complete the form and submit the request to server. I could forward the user to a new page and display the status bar but  I willl have to disable the 'Browser back' option until the job is done

Is it possible, to redirect the user to the same form and popup a display a modal dialog box with the progress bar

The input form is postback to the server and does not use AJAX to post..

Or would you suggest a different method
SOLUTION
AnuTiji

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
vid_yag

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Julian Hansen

The solution depends on what you want to achieve.

A) You want to show a progress bar on a particular page until a particular process is done - but user can (will) browse to other pages in the interim

B) You want to stop navigation on the site until the process is finished showing a progress bar while the background process is incomplete

Which of these (or is there another option) are you wanting?
SiemensSEN

ASKER
Thanks for your help..

I would like the user to wait for the job to complete. ... Option B
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Julian Hansen

Ok - obviously taking into account that you cannot force the user to stay on the page - the user can browse away and return in which case do you want to cater for this i.e. if a user hits the back button - what happens - do you want to force a redirect back to the status page?

If the user browses away and returns - do you want to force the user to a specific page with a status.

Modal popups in browsers are simulated - they are not true modals - you are just hiding the rest of the page behind a div on top of which sits the div that contains your code - so you need to take the above questions into consideration - there is more to this than just poping a pseudo dialog.

The code I posted earlier is all you need on the page - you can locate it in a div which you can style to be a popup - you can also have it so that

a) You are always redirected to this page if there is a status pending
OR
b) each time you return to the page the updated status is shown and progress continues - as per the posted example.