PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multiple Form Submissions

  1. SqueezeDigltal
    Member

    Hi,

    When my form is submitted i post the data to an external url using gform_post_submission and redirect the user based on the response.

    This can sometimes take a couple of minutes and i find that impatient users are repeatedly hitting submit and thus posting the form multiple times.

    How would I disable the submit button after it has been pressed to stop this happening? and is it possible to also show a 'please wait...' message whilst they are waiting for a response?

    Thanks,

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  2. You can use a little jQuery or JavaScript to disable the button after it's clicked.

    http://www.gravityhelp.com/forums/topic/stopping-multiple-form-submissions#post-19661

    The redirect really takes a couple minutes? I don't think I'd have the patience to wait either! Maybe something can be sped up in that process?

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  3. SqueezeDigltal
    Member

    Thanks.

    I'm not sure how to add code into a specific page but i added

    $(":submit").click(function(){
      $(this).attr('disabled', 'disabled').val('Please wait...');
    });

    to header.php and it didn't work.

    What am I doing wrong?

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  4. If you want to add it to header.php, you will need to add script tags.
    http://www.gravityhelp.com/documentation/page/Where_Do_I_Put_This_Code%3F

    Try this:

    [js]
    <script type='text/javascript'>
    $(":submit").click(function(){
      $(this).attr('disabled', 'disabled').val('Please wait...');
    });
    </script>

    That will run on every page if you enter it in header.php.

    Posted 13 years ago on Thursday August 25, 2011 | Permalink
  5. Doesn't work. I put this in Header.PHP and I still get multiple submissions when people refresh the page or use the back/forward buttons. It's bloody annoying too because I get people signing up for my Mailing List and they get 3 and 4 notification emails and want to unsubscribe because they think I'm spamming them. It makes it impossible to use the form on my main page or in a sidebar widget as people keep submitting over and over again.

    Posted 12 years ago on Thursday January 19, 2012 | Permalink
  6. I have the same "Multiple Form Submissions" as Daniel Berman. I try the code above and it didn't work. Anybody can help?
    Thanks,

    Posted 12 years ago on Thursday April 5, 2012 | Permalink