Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8304727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:55:25+00:00 2026-06-08T17:55:25+00:00

I have a loading div that shows in between different calls to the server.

  • 0

I have a loading div that shows in between different calls to the server.
Here is the code:

$("#submitButton").click(function () {
        $("#loadingDiv").show();
        $(this).attr("disabled", "disabled");
        $("form:first").submit();                        
    });

It all works well if I comment out the third line of code to submit the form. But when I put the code to submit the form next to these ui update calls, none of them take effect, and the browser wait cursor shows till the result of the form submit are displayed.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T17:55:26+00:00Added an answer on June 8, 2026 at 5:55 pm

    You need to add preventDefault() to prevent the default submit from occurring. As you have it, the form is being submitted before any of the click handler code can run.

    $("#submitButton").click(function (e) { // note event object passed in
        e.preventDefault(); // add this
        $("#loadingDiv").show();
        $(this).attr("disabled", "disabled");
        $("form:first").submit();                        
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a loading image that works using the code below. It shows the
I am loading some text dynamically into a div, but have the problem that
I have this: function startLoad(object_id) { $j('div#'+object_id).addClass('currently-loading'); var con = $j('div#overlay'); var img =
I have a js script that shows loading image and than loads content into
I have somethign like this: <div id=container> <img id=screenFirstImg> </div> And js: $('a.screenThumbLink').click(function(){ console.log(
I have a javascript function that loads 100 div's from a xmlhttprequest function. I
I have problem while loading data into html select when users press or click
I have following code for loading image from url in xml parsing endElement method
I have this div that is supposed to be hidden when the page loads
I have a page that has lots of images and other code that would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.