Click to See Complete Forum and Search --> : HTML form, insert an image when you click the submit button


alexislalas
05-22-2009, 12:18 PM
Hello,

How can I insert an image once the user clicks the submit button in a form?

The process behind the form action takes 2-3 minutes and I want to display an image of a clock while it's processing so that the user knows that it's taking time to process the request.

Thanks!!

kostis12345
05-22-2009, 01:12 PM
Just qurious,why does the form take so much time to finish the process ?

alexislalas
05-22-2009, 02:02 PM
it interacts with 3 different web services that are in different web servers.

kostis12345
05-22-2009, 05:56 PM
Oh,I see.
I'm sorry but the only thing I can think of is popups which don't seem to be what you're looking for so we(I'm also interested in learing how to do that :P) have to wait for someone with more experience to reply.

Weedpacket
05-22-2009, 07:08 PM
You want all this to happen before the response comes back from the server (that's two or three minutes away, after all). Since PHP runs on the server, it's not going to be available; so you're going to have to do it on the client, using JavaScript. Have the loading image in a hidden <div>, and display it when the form submits.

Later on, if you want to get really fancy, you can add a periodic Ajax update that queries the server to see how things are getting on and provide feedback on progress.

Since this is a clientside issue, I'm moving it to the clientside forum.