how to add clock timing indicator?

Posted on 2011-04-27
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?


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

Open in new window

Question by:Alpita
    LVL 23

    Expert Comment

    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.

    Author Comment

    In my project environment, they dont use AJAX.
    Could it possible in jsp?

    LVL 23

    Accepted Solution

    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">
    function form_submit(){
    document.getElementById("imageHere").innerHTML = '<img src="image.gif" alt="Alternate text" />';
    //submit the form here

    Open in new window


    Author Closing Comment


    Featured Post

    Gigs: Get Your Project Delivered by an Expert

    Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

    Join & Write a Comment

    We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
    This is an issue that we can get adding / removing permissions in the vCSA 6.0. We can also have issues searching for users / groups in the AD (using your identify sources). This is how one of the ways to handle this issues and fix it.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now