Click to See Complete Forum and Search --> : Creating a delay in refreshing a page
benny666
10-22-2003, 07:41 PM
I want to publish a form that when the user will click submit
the page will show wait... and then move to the next form
the trick is that I need this wait to be an arbitrary time depending on the wait for the database response
can any one help???
SnowCrash
11-03-2003, 03:33 AM
Hi
You can solve your problem on the server side by sending back the "wait..." until the database request is finished during processing of your database script. In asp you would use Response.Flush and in php just flush();
benny666
11-09-2003, 07:52 AM
I want to clerify my question,
The page is looking up information in a database,
gettting the result back after 2 seconds and then I need to wait 1 minuit for the page to load since the values of a drop down list are too long there are about 3600 values in the drop down???
vitalise
11-20-2003, 07:38 AM
I've done this sort of thing before. The trick is to return an intermediate page that displays an animated gif or something while it waits for the query to complete.
So ..
Page 1 has your form but the action for the form is not the page that does the actual query but the intermediate page - page 2.
Page 2 gets returned straight away and displays a nice message saying 'please wait ...' and then IT posts the query from the form on page 1.
Page 3 returns your actual results which can take as long as you want because while the browser is trying to load it it's displaying your nice page - Page 2.
Hope that's clear.