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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:11:18+00:00 2026-06-10T15:11:18+00:00

What I’m trying to do: Submit a form to a script that will run

  • 0

What I’m trying to do: Submit a form to a script that will run in the background, provide a loading text with animated dots in the input field, and return a message once done in that very same field.

The problem: I manage to catch the input variable and display the animated loading message. I’m somewhat new to this so the nested code is probably a mess and the loading display should probably be a function that can be nested (if I’m understanding this correctly). It stops at displaying the loading message so I assume the form never actually gets submitted and the whole script just comes to a hault somewhere.

What I have:

<script>
  jQuery(document).ready(function($)
  {
    $("#subsenid").submit(function(e)
    {
      e.preventDefault();
      var senid = $("input:text[name=submit_sen]").val();
      i = 0;
      setInterval(function() 
      {
        i = ++i % 4;
        $("#submit_senid").val("Importing"+Array(i+1).join("."));
      }, 500, function()
        {
          $.get("/inc/receiving_script.php", {psnid: senid}, function(data)
          {
            $("#submit_senid").val("All done");
          });
        }
      });
    });
  </script>

Long story short: Submit form, display animated loading message and return message from script (I just added the “All done” message instead of proper return messages from the script to see if anything happened at all).

Any pointers and suggestions in the right direction is greatly appreciated.

If more information is needed I’ll provide it as quickly as I can.

  • 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-10T15:11:20+00:00Added an answer on June 10, 2026 at 3:11 pm

    Are you using something like firebug or similar? You should. It’s a plugin for firefox that helps you debug your code. (other modern browsers have similar consoles and tools, usually you can access them by right clicking in your page and selecting ‘inspect element’ or similar)

    If you open firebug you will be able to see the ajax call to your script, and what its results are. Also it allows you to set an execution break point in your code (set one in the beginning of your submit handler) and walk through your script line by line. That way you can see what is actually happening and check the contents of your variables etc. Also the DOM can be examined easily. Invaluable help for any front end developer!

    Secondly I see some problems in your code. You execute the ajax call in an anonymous function and provide it to setInterval as a 3rd param, which won’t work. You need to start animation, execute the ajax call, and in the ajax callback stop animation and set your retrieved data where you want it.

    Untested, but something like this should put you on the right track:

    jQuery(document).ready(function($){
    
        $("#subsenid").submit(function(e){
            e.preventDefault();
            var senid = $("input:text[name=submit_sen]").val();
            var i = 0;
    
            var animationInt = setInterval(animateBox, 500);
            function animateBox(){
                i = ++i % 4;
                $("#submit_senid").val("Importing"+Array(i+1).join("."));
            }
    
            $.get("/inc/receiving_script.php", {psnid: senid}, function(data){
                clearInterval(animationInt);
                $("#submit_senid").val("All done");
            });
        }
      });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text

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.