call javascript function after validation

E

Eirik Eldorsen

When the user clicks a button on my page, a server side operation starts
which takes several seconds to complete.
To make the user less impatient I want to show a animating gif when he/she
clicks the button. I've been able to do this by calling a function by using
the onclick event of the button. My problem is that the function is always
called. I only want it to be called if page validation returns true. Is this
possible?
 
L

Lucas Tam

I only want it to be called if page validation returns true. Is this
possible?

You'll need to redirect to a processing page, then continue processing
while displaying the animated gif.
 
E

Eirik Eldorsen

I was considering that solution, but I don't know how to autmatically start
the processing code. I can't put it in the Page_Load method. Can I put the
processing code in a thread, that I start in Page_Load?
 
L

Lucas Tam

I was considering that solution, but I don't know how to autmatically
start the processing code. I can't put it in the Page_Load method. Can
I put the processing code in a thread, that I start in Page_Load?


Check this article:

http://www.informit.com/articles/article.asp?p=174363&f1=nl;-158095;2004-
07-19

You can also use the same page as the form entry page, but just turn off
all the controls and display the "please wait page". That way you don't
need to redirect.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top