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.

Submitting same form multiple times

  1. June22
    Member

    Hi,

    i set up a multiple page form using Gravity Forms. This form is limited to 100 entries, because people who are filling this form will receive a free gift.

    At the end of the form, if i click multiple times the submit button, it creates multiple entries.
    I don't know if this is the desired behavior, but because some newbie users might think they have to "double-click" buttons on the web, or because they think the page load is slow, this behavior would result in multiple entries for my form.

    I absolutely need to avoid this because they would then be nelisted to receive more than one gift, and take the gift from someone else !

    I tried setting up the email field to be unique (disallow duplicate on this field) but that doesn't change anything..

    How can i handle this with Gravity Forms ? Did i do domenthing wrong, or is this the normal behavior ?
    Thanks for helping

    Posted 12 years ago on Monday September 10, 2012 | Permalink
  2. June22
    Member

    same thing happen if i refresh the submitted form with POST datas. Even with the No Duplicate option on.

    Posted 12 years ago on Monday September 10, 2012 | Permalink
  3. You can disable the submit button after it is submitted by using this snipped of jQuery:

    http://www.gravityhelp.com/forums/topic/disabling-the-submit-button-to-prevent-multiple-entries#post-73087

    Would that help in your situation?

    Posted 12 years ago on Monday September 10, 2012 | Permalink
  4. June22
    Member

    That would partially resolve the problem : if the user reload the page on the confirmation message, POST data would still be send again to the server, and Gravity Forms would add a duplicate entry for this form (even if the email field is set to no duplicate!).
    I could set the confirmation message to be a page, so the user can't refresh and relaunch the POST request, but i think he could still click the browser back button and experience the same issue..

    I thought there were a server-side validation based on the unique id or something to avoid this ?
    Storing this id in the server session and flush it once the form has been submitted would forbid user to submit the same form again i guess ?

    That would be a nice feature.. But if this doesn't exist yet, i'll stick with the jquery solution, thanks.

    Posted 12 years ago on Monday September 10, 2012 | Permalink
  5. If you check the 'no duplicates' setting for the email address, you should not be getting multiple entries with the same email address.

    Are you using any caching plugins? Those can interfere with form submissions sometimes and might make the no duplicates option not work correctly.

    Posted 12 years ago on Monday September 10, 2012 | Permalink
  6. June22
    Member

    No caching plugins.
    But i have 2 pages in my form.
    the email field is on the first page of my form, so Gravity Forms probably doesn't validate it when submitting the whole form on page 2.
    It thinks it doesn't need to be done because it was validated after page 1 was submitted.
    But if the user reloads the confirmation message and resend the POST request with all the form fields, duplicates won't be checked for fields on page 1, thus i can several entries with the same email..

    I think i will use the validation hook to force Gravity Forms to double check my email field. But this looks like a bug to me ;)

    Posted 12 years ago on Monday September 10, 2012 | Permalink
  7. I'll bring it to the attention of the developers. Thank you.

    Posted 12 years ago on Wednesday September 12, 2012 | Permalink
  8. I have a similar problem, but it also involes using the authorize.net and paypal pro addons. People are submitting duplicate payments, and I'm not sure if its because they hit refresh or clicked the submit button multiple times. Is there anything in those addons that can help me prevent duplicate payments?

    Posted 12 years ago on Monday October 1, 2012 | Permalink
  9. There is nothing in either of those add-ons which can help prevent this. In my experience, it's because people are impatient and are not sure anything happened, so they click again, not refresh the page. When you refresh a page with a form submission, normally the browser puts up a dialog and asks if you really want to do that. There is no such dialog when submitting a second time. If that is happening to you, I recommend disabling the submit button after submission, or hiding it after submission, or changing the text on it and disabling it.

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  10. I thought of something else that I believe works as a work-around to this problem without having to code anything additional.

    1) Make the confirmation be a thank you page
    2) Add a captcha to the form (the captcha regenerates on each submission)

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  11. That's a good idea too. Did you implement that with success?

    Posted 12 years ago on Tuesday October 2, 2012 | Permalink
  12. I too am experiencing the double submission.

    I'm looking at the jquery hacks to add and evaluating implementing.

    Seems if folks are having an issue with this it would make a nice addition to the standard code base so that nobody ever has this problem.

    Either
    1. Disabling the submit button when clicked
    2. Change the "Submit" button to "Submitted" when clicked.

    Best option would be disabling the submit button and letting people double-click, triple-click, 1000 click to their hearts content and have it only count as a single click.

    Posted 12 years ago on Thursday November 1, 2012 | Permalink
  13. tcs
    Member

    Turning on Ajax helped eliminate accidental duplicates for me. This may be of use until some server side solution is implemented by gf.

    Posted 12 years ago on Thursday November 1, 2012 | Permalink
  14. @Scott, you can do as you describe right now using jQuery. We'll keep this one tagged as a feature request for future reference.

    Posted 12 years ago on Thursday November 1, 2012 | Permalink
  15. http://www.gravityhelp.com/forums/topic/submitting-same-form-multiple-times#post-78428

    Yeah Chris, that does seem to work with the sites that I've used it on. I'm not seeing duplicate payments anymore. Ideally I'd like to see some sort of true nonce involved here.

    Posted 11 years ago on Wednesday November 28, 2012 | Permalink
  16. We'll leave it tagged as a feature request for that reason. Thank you.

    Posted 11 years ago on Saturday December 1, 2012 | Permalink
  17. We just had to deal with this on a client site and took a two-pronged approach:

    1. Disable the button via JavaScript after the first click
    2. Create a hash of the $_POST variables, store it in a session, then compare subsequent submissions' hashes. If there's a match we force a honeypot failure (form data appears to go through but the data isn't saved) for the duplicate entries.

    We released it as a plugin today, please give it a try at let us know if it works for you:
    http://wordpress.org/extend/plugins/gravity-forms-duplicate-prevention/

    Posted 11 years ago on Friday February 8, 2013 | Permalink
  18. David Peralty

    Great stuff, we hope to hear feedback from people on how well it works.

    Posted 11 years ago on Friday February 8, 2013 | Permalink