?
Solved

how to add clock timing indicator?

Posted on 2011-04-27
4
Medium Priority
?
437 Views
Last Modified: 2012-05-11
Hi Expert,

I have a submit button in my .jsp file. When i click , it takes time to display the response.
Can i have some sample code to display waiting icon(some kind of clock indicator) . Once i get response it should not show up?

Thanks,
Alpita

<TR>
  <TD ALIGN=CENTER>
    <INPUT TYPE=BUTTON  ID="butSubmit" VALUE="Submit" onClick="form_submit()">
  </TD>
  <TD ALIGN=CENTER>
    <INPUT TYPE=BUTTON NAME="close" VALUE="Close" onClick="window.close()">
  </TD>
</TR>

Open in new window

0
Comment
Question by:Alpita
  • 2
  • 2
4 Comments
 
LVL 23

Expert Comment

by:cmalakar
ID: 35477487
Better do with AJAX.

On submit of form, show a progress image on the page, Send an ajax request with form details.
Once the ajax request is completed, just forward to the success/failure page based on the ajax request/response result.
0
 

Author Comment

by:Alpita
ID: 35477586
In my project environment, they dont use AJAX.
Could it possible in jsp?

Thanks,
Alpita
0
 
LVL 23

Accepted Solution

by:
cmalakar earned 2000 total points
ID: 35477682
You dont need any special environment for AJAX. It works with javascript.

Anyways, Without AJAX, You could do this.

put a empty div in your jsp. And on submit of form, put the required image tag in the div inner html.
Then submit the form.
<div id="imageHere">
</div>

<script>
function form_submit(){
document.getElementById("imageHere").innerHTML = '<img src="image.gif" alt="Alternate text" />';
//submit the form here
}
</script>

Open in new window

0
 

Author Closing Comment

by:Alpita
ID: 35695462
Thanks
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
With more and more companies allowing their employees to work remotely, it begs the question: What are some of the security risks involved with remote employees and what actions should we take to secure them?
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month16 days, 14 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question