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 7031889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:51:45+00:00 2026-05-28T00:51:45+00:00

The script is simple, but cant work. I don’t know what’s wrong <script type=text/javascript>

  • 0

The script is simple, but cant work. I don’t know what’s wrong

<script type="text/javascript"> 
$("#save-form").submit(function() {
    $("#wait").show();
    return false;
});
</script>
<div class="myform">
<form id="save-form" method="post" action="/save/">{% csrf_token %}
    {{ form.as_p }}
    <button type="submit">submit</button>
    <a href="/.">{% trans "cancle" %}</a>
    <div id="wait"><img src="{{ STATIC_URL}}webimages/ajax-loader.gif"></div>
</form>
</div>

Because the form needed process 3-4 seconds, I want to add a loading image while the form be submitted. When click submit, I can see lower right corner shows waiting for x.x.x.x …, and redirect to another page lately.

Thanks!!

  • 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-05-28T00:51:45+00:00Added an answer on May 28, 2026 at 12:51 am

    Try:

    
    $(function() {
      $('#save-form').submit(function(e) {
       $("#wait").show();
        e.preventDefault();
        var $form = $(this).unbind('submit');
        setTimeout(function(){
          $form.submit();
        }, 100);
      });
    });
    
    

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to save a simple script in netbeans to htdocs, but i only
I checked all the topics, but i simply don't know why my script does
I am currently developing a very simple script in AutoHotKey, but it involves using
This is a simple VBS script. But when I double-click on this, I get
I'm trying to get this simple PowerShell script working, but I think something is
Any simple, but secure script available for Flash > MySQL DB integration? I need
I'm not sure how simple this would be, but I'm using a script which
I want a simple MessageBox for ASP.Net, but everything I tried didn't work and
this looks simple enough but I just can't get it to work. I could
i have problems with ajax requests and simple <input type=submit/> . i use to

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.