Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Displaying an progress/indicator gif while form submission  RSS feed

 
Gary Dhaliwal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I wanted to know how would can I display a progess/indicator gif upon submitting a form, due to the fact the form may take several seconds for submission.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most browsers will not play animations during a normal submission, so the best you can do is to display a static image or message.

If you really want the browser to remain active while the submission is transpiring, you'll need to use Ajax to submit the form "behind the scenes".
 
asdf lkjh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We had a similar requirement in our application, we solved it by displaying a gif image on every sumbit (which has a marquee arrow which moved back and forth.) But the Unix server on which we have hosted our application did not animate the gif image, so, we had to take 50 images and rotate them in the loop. (second one is very bad solution, but it worked.)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sushant pophli:
But the Unix server on which we have hosted our application did not animate the gif image
The server has nothing to do with animating an image. It's the browser that controls that.

The best way to achieve any kind of progress indicator -- even if it's a simple GIF animation -- is to employ Ajax to submit a form while the browser remains active and responsive.
 
Gary Dhaliwal
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies, but could'nt this simply be achieved using javascript? Something like onsubmit? And please be specific in your responses.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Specifically, no. Without Ajax (which is JavaScript, by the way), JavaScript also stops running between pages.
[ October 19, 2008: Message edited by: Bear Bibeault ]
 
asdf lkjh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
--not relevant anymore--
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!