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

  • SEARCH
  • Home
  • 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 8182593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:54:27+00:00 2026-06-07T00:54:27+00:00

I have a problem in firefox, where I’m trying to get a form submission

  • 0

I have a problem in firefox, where I’m trying to get a form submission button to display “loading” when a person clicks on it (to prevent multiple submissions of a user clicking it two/three times due to a slow site).

I have this jquery code:

$(document).ready(function(){
     $('.submitButton').click(function() {
        document.aform.submit();
        $('.buttonSpan').html('<button class="btn btn-primary disabled">Loading...</button>');

     });
});

Chrome executes it correctly, but Firefox only changes the HTML in the span surrounding but doesn’t submit the form. Firefox submits when i click the button twice. If I remove the line of the .html() changing, it also submits with no problem.

Here is the form code for reference:

<form name="aform" action="index.php" enctype="multipart/form-data" method="post">
    ...form data
    <span class="buttonSpan">
         <button class="btn btn-primary submitButton" name="submit"/>Submit</button>
    </span>
</form>

Does firefox put precedence on html changes and ignore everything else? Again, this works fine in Chrome, but firefox is really killing me!

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-06-07T00:54:29+00:00Added an answer on June 7, 2026 at 12:54 am

    In most cases it is better to use the submit event on the form instead of the click event of the submit button. (what if you submit the form by pressing the enter button?)

    $(function(){
         $('form[name=aform]').submit(function() {
            $('.buttonSpan', this).html('<button class="btn btn-primary disabled">Loading...</button>');
    
         });
    });
    

    When using this, you will need to fixed the html of your submit button as I have stated below.

    Otherwise I suggest finding the form relative to the submit button:

    $(function(){
         $('.submitButton').click(function() {
             $(this).closest("form").submit()
            .find('.buttonSpan').html('<button class="btn btn-primary disabled">Loading...</button>');
    
         });
    });
    

    Also the proper way of defining your submit button is like this:

    <input type="submit" class="btn btn-primary submitButton" value="Submit" name="submit"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have had a problem in firefox (using 10.0.2) trying to use javascript to
I have problem with display of correct javascript in IE9. Other browsers (Firefox, Opera,
Hi guys I have a problem with cookies on firefox I'm submitting a form
I have a problem with the Firefox browser. You can see it here .
I have a problem with my google chrome and firefox (the only 2 browsers
I have a very weird problem in Firefox ( version 3.5.2), and I am
I have a problem with my jquery UI tabs currently only in Firefox 3.6.24
I have a problem where an element is not showing on Opera nor Firefox.
I have a problem that happens in IE 8 and Firefox 6.0 but not
I have a strange problem working with HTML,CSS in different browsers: Firefox 3.6 and

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.