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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:50:26+00:00 2026-05-25T16:50:26+00:00

I have the following code which I use to submit forms with links (instead

  • 0

I have the following code which I use to submit forms with links (instead of buttons). This is so that we can do some CSS hover stuff with them.

$('a.css_submit').click(submit_form);
$('a.inactive_submit').click(submit_form);

function submit_form(event) {
  if ($(this).parents('form:first').length > 0 && !$(this).hasClass('inactive_submit'))   {
        $(this).toggleClass("css_submit inactive_submit");
    $(this).parents('form:first').submit();
    return false;
  } else {
    return true;
  }
}

The issue is that Internet Explorer occasionally submits the form twice. I haven’t been able to replicate the problem myself, but I can verify it in my production server logs. This problem persists in IE6 – IE9. All other browsers work fine. I’ve seen some posts that say to return false from the link, but I’m doing that.

Any help is appreciated.

  • 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-25T16:50:26+00:00Added an answer on May 25, 2026 at 4:50 pm

    You could add some extra validation to make sure it doesn’t get clicked twice:

    var formSubmitted = false;
    
    function submit_form(event) {
      if(formSubmitted  == true) { alert('Form already submitted.'); return false; } // determine if form is already submitted
      if ($(this).parents('form:first').length > 0 && !$(this).hasClass('inactive_submit'))   {
            $(this).toggleClass("css_submit inactive_submit");
        $(this).parents('form:first').submit();
        return false;
      } else {
        formSubmitted  = true;
        $('a.css_submit').attr('disabled', true); // disable form submit button
        $('a.css_submit').val('Processing...'); // set form submit button text to say processing
        return true;
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code which I use to match fancybox possible elements: $('a.grouped_elements').each(function(){
I'm trying to use opengl in C#. I have following code which fails with
I have the following use case , lot of code which was tightly coupled
I am trying to use the following code, which I have not been able
I have following Code Block Which I tried to optimize in the Optimized section
I have the following code which works just fine when the method is POST,
I have the following code which works fine. However, I only want to return
I have the following code which should put programs startable in Bash. if [
I have the following code which reads in the follow file, append a \r\n
I have the following code which re-uses a CookieContainer which logs in on the

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.