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 notifications sent when refreshing confirmation page

  1. I was editing my first form (the contact page) when I discovered what might be a small bug. During the time I was editing and checking the confirmation page, I would refresh the page (hitting the F5 key) to view my changes. I did that 4 times. The next time I checked for email, I got 5 of the same test message. The original came, then 4 duplicates came and the time stamps were about a minute apart - right about the same times that I was doing my editing.

    This could be a problem that would result in numerous duplicate emails if someone with bad intentions kept hitting refresh after sending a message.

    Posted 11 years ago on Friday June 8, 2012 | Permalink
  2. A client just reported getting multiple copies of a notification over a few days. Could this be if the person had bookmarked the confirmation page or some other way kept going back to it?

    Posted 11 years ago on Thursday June 28, 2012 | Permalink
  3. @Jim, this is browser functionality. If you refresh the page, the form is submitted again. Different browsers handle it differently. Some browsers put up a dialog mentioning that you are submitting a form again. It's nothing Gravity Forms can interfere with. If you want to prevent duplicate submissions from one email, you can use the "No Duplicates" checkbox for any individual field, like the email address.

    @anndonnelly, there is nothing in Gravity Forms which would do this, so it's entirely possible the page was bookmarked. Some plugins can cause multiple notifications as well, but that normally happens quickly, right after the form submission.

    Posted 11 years ago on Thursday June 28, 2012 | Permalink
  4. Hi,

    I have a similar issue initially reported by my client and so I hooked myself up to receive notifications from the same form.

    The first notification that I got arrived as it should but the second arrived twice. My client reported the issue when he received 6 notifications for the same entry. He received 7 and then 8 to my 1 and 2.

    I don't think that this is a browser issue.

    Thanks for your help

    Posted 11 years ago on Monday July 30, 2012 | Permalink
  5. ptaylor1001, please provide a link to your site.

    This can be due to caching plugins. Or it could be a plugin or theme conflict. You can test for this by following the instructions here http://rkt.gs/testing

    Posted 11 years ago on Tuesday July 31, 2012 | Permalink
  6. Hi chris,

    The link is http://www.offshoreinvestmentguide.eu

    Thanks

    Philip

    Posted 11 years ago on Wednesday August 1, 2012 | Permalink
  7. I submitted a test on this page:
    http://offshoreinvestmentguide.eu/offshore-investment-guide/

    I have received one email so far from:

    info @fundadvisers.com via p3nlhg622.shr.prod.phx3.secureserver.net

    Is it the admin notifications which arrive multiple times? Or will the user notifications arrive multiple times as well?

    Have you already tested for theme and plugin conflicts? http://rkt.gs/testing

    Posted 11 years ago on Wednesday August 1, 2012 | Permalink
  8. tcs
    Member

    I had a customer fill in a form including a payment in the evening. All went through ok. The next day the customer apparently went back to their device and refreshed the browser (Safari left open from the previous day with the confirmation text still showing)- bang another payment gets processed and another entry created.

    The noduplicates checkbox sounds good but I can see how to apply it in my situation. Customers return and fill in forms and make payments all the time so I don't want to stop that.

    Is there any way to obliterate all the post data once the form is submitted successfully the first time so that even if they refresh - use the back button or whatever there is no hope of the submission / payment going through again ?

    I am thinking of switching to a re-direct to thankyou page to see if that helps. Feeback from customers who have been charged twice is "fix your website" and even if they may technically be the cause they don't see it that way!

    It sure would be great if once a form was submitted successfully it couldn't be submitted again!

    Posted 11 years ago on Wednesday October 17, 2012 | Permalink
  9. I think I would switch to the thank you page and see if that helps.

    Posted 11 years ago on Wednesday October 17, 2012 | Permalink
  10. tcs
    Member

    Ideally I would like to stop people resubmitting their forms no matter what.

    I thought about generating my own unique tran id and populating a hidden field dynamically and then turning on no duplicates for the hidden field. That should work shouldn't it ? - but I see that a hidden field does not support the no duplicates option.

    Not allowing the same form to be submitted twice by accident through browser refresh / back button or whatever seems fundamental but given it isn't built in to gravity forms would the above idea do the job and if it will could you point me in the right direction on how to implement noduplicates on the hidden field.

    If there is some kind of jquery magic that achieves the same result (stops resubmission on browser refresh) that would also be great if anyone can point me to it.

    Posted 11 years ago on Thursday October 18, 2012 | Permalink
  11. I wonder if this is a problem with any form submitted with a page refresh, in Safari, as you described, or if it is somehow related just to Gravity Forms? If the problem is unique to Gravity Forms, I wonder how it's prevented with other form solutions (or forms in general.)

    How about using a 303 redirect on the thank you page?
    http://tumblr.jonthornton.com/post/7902581999/preventing-form-re-submission-with-http-303-redirects

    More reading:
    http://bjw.co.nz/developer/general/75-how-to-prevent-form-resubmission
    http://stackoverflow.com/q/2136954

    Posted 11 years ago on Thursday October 18, 2012 | Permalink
  12. tcs
    Member

    I think refreshing any browser when you have the confirmation option set to text on a confirmation page is resubmitting the form data. Definitely on ie9 as well.

    I am happy to test 303 redirect (for my text based confirmation) to see if it stops form data being resubmitted when users click the browser refresh but how can this be implemented ? Is there some filter or hook - could someone at gf post the code ? If I switch from the text confirmation to a page confirmation does that use a 303 redirect?

    Thanks for posting the reading. It seems there are a number of ways to stop accidental resubmission and that it can be done if you want to. Is it on the road map at gravity forms?

    Posted 11 years ago on Thursday October 18, 2012 | Permalink
  13. @tcs: I reckon the simple answer for your specific problem is if I modify the payment gateway to always check for a successful transaction number recorded in the form data, before submitting to eWAY again. I'll have a play with that and the result should be a new release of the eWAY plugin soon.

    cheers,
    Ross

    Posted 11 years ago on Friday October 19, 2012 | Permalink
  14. Scratch that, although GF generates a unique ID for a form entry, it doesn't actually store the bugger! If it did, it would be a simple matter to grab the saved lead with that unique ID; finding it saved would indicate that the form has been processed, so don't do it again (in fact, GF ought to be doing that itself).

    @Chris Hajer: once an entry has been saved, is there a way to test for that if the page is refreshed? A cursory look here hasn't found such a way. Storing the unique ID of the entry would help.

    I could work around this by storing the unique ID in my plugin's field data (thus complicating storage / retrieval of that data) or storing it in a separate, meta field (probably better as easier to search on), but...

    I can't actually reproduce the problem here on my browsers. I've tried a few times, but can't seem to make it submit another payment attempt; refreshing either brings up the confirmation again, or brings up a blank form. Steve, maybe you could email me the XML export of your form so that I could have a play with it. Maybe I need to try it specifically on Safari, which I have an old (5.11) copy on Windows or the mobile version on iPad.

    cheers,
    Ross

    Posted 11 years ago on Friday October 19, 2012 | Permalink
  15. @tcs: are you using a caching plugin?

    Posted 11 years ago on Friday October 19, 2012 | Permalink
  16. @tcs: I just noticed I had AJAX form submission turned on, which avoids this problem.

    So, quick fix for most users: use AJAX form submission and they can't accidentally resubmit the form. Of course, this doesn't resolve the problem for users with JavaScript disabled / broken / limited by policies.

    Posted 11 years ago on Friday October 19, 2012 | Permalink
  17. tcs
    Member

    @webaware: I have AJax off so thanks for the tip - I will check with Ajax enabled. Yes also to a caching plugin (quick cache) however this is disabled on all form pages and I don't use it in my sandbox test environment and the problem is apparent there.

    Posted 11 years ago on Friday October 19, 2012 | Permalink
  18. I have a working fix, I would like to get your help testing it please. You can download an alpha of v1.2.3 from this URL and test.

    http://www.webaware.com.au/files/gravityforms-eway-1.2.3-alpha1.zip

    What it does is save the entry's unique ID in a meta value for the form, gfeway_unique_id, and checks to see if that value is present when validating the credit card information. If it finds it there, it invalidates the form with the following error message on the credit card field:

    Attempt to submit form multiple times; already processed.

    Please let me know how you go.

    cheers,
    Ross

    Posted 11 years ago on Friday October 19, 2012 | Permalink
  19. tcs
    Member

    Hi Ross@webaware.

    Thank you for getting this fix out within the hour. It seems in that hour you have found a way to detect and stop accidental form resubmissions on the server side. Maybe the gravity guys could check this out.

    Your updated eWay plugin is now stopping duplicate payments through accidental form resubmisisons. I did not find a problem when I tested using a single and multi page form. On the multi page the credit card field is on the last page so I see the error warning. I suspect if it isn't on the last page your error may not display. They would see your form has errors see below and not actually see the error if the credit card field isn't on that page. Please also note I only tested with single payments not recurring (not sure if that makes a difference).

    Using ajax seems to stop accidental form re-submissions also but this may not be desirable for all users, In fact I setup a simple payment form and disabled javascript to see what happens. If you have ajax on it seems you are stuck as it doesn't degrade to a regular submit. You click submit and stare at the screen for a while before you realise nothing is going to happen. Turn ajax off and it works fine - duplicate payments nicely protected by your handywork.

    My only suggestion would be to look at the error message text or make it customisable in the admin. A customer may get quite baffled on what to do next when confronted with their accidental resubmission message. Something like - "Payment already submitted and processed - please close your browser window" to stop them refreshing again, back, forward and such. If that message could also override the generic large 'There was a problem with your submission. Errors have been highlighted below' message that appears at the top of the form it would be even better as they would definitely notice it no matter if the credit card field was on the page or not.

    So at this point for the folks at gravity forms:
    Thanks for your help so far:
    1) If your not using ajax - can the problem of accidental form resubmissions through browser refreshes when using confirmation text be addressed somehow ?
    2) If you do use ajax and customer has disabled javascript - shouldn't it degrade to a regular submit ? It doesn't seem to do so in my testing.

    Posted 11 years ago on Saturday October 20, 2012 | Permalink
  20. @tcs: thanks for testing, and good idea about custom error messages. I'll see what I can do this week, before I release this fix. Regarding multipage forms, it should already work OK because I set the form page to return to the page with the credit card field when invalidating it. This fix will work with both one-off and recurring payments, because the check is done before determining which payment type is required.

    @Gravity Forms: Steve is correct, the AJAX form method should really fall back to regular form submissions when JavaScript is disabled. For stopping form submissions, the unique ID should be a sufficient test if the website is single-hosted. I don't know how/whether you would add this to Gravity Forms core, but I'll be maintaining this fix in my plugin in the meantime (to be releases this week).

    cheers,
    Ross

    Posted 11 years ago on Sunday October 21, 2012 | Permalink