/    Sign up×
Community /Pin to ProfileBookmark

Creating a delay in refreshing a page

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???

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@SnowCrashNov 03.2003 — 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();
Copy linkTweet thisAlerts:
@benny666authorNov 09.2003 — 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???
Copy linkTweet thisAlerts:
@vitaliseNov 20.2003 — 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.
×

Success!

Help @benny666 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...