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.

Only one submission per forms

  1. Hello,

    I search how to or how can i do for users can only view/submit on time with each forms of my site ?

    Thanks in advance for your help.

    Posted 13 years ago on Friday September 17, 2010 | Permalink
  2. There is no built in way to limit entries per user, only form wide. This could be implemented, however it would take a customization using PHP and available hooks to do so.

    Posted 13 years ago on Friday September 17, 2010 | Permalink
  3. Thank you for your quick respons.

    Could you give me some ways to simplement it ? Like files names and functions to modify ?

    Posted 13 years ago on Friday September 17, 2010 | Permalink
  4. Just realized a simple way you could implement this.

    Edit your form and then edit the Email field. Under the "Rules" area check the "No duplicates" checkbox. This will now enforce a no duplicates rule for that Email field meaning only one entry per email address will be allowed.

    You can then go to the Advanced tab for that same field and enter a custom validation message that will be shown as an error if they try to enter twice.

    By adding that "No duplicates" rule to that field you make it so only one entry will be allowed with that email address which should accomplish what you want to do.

    Posted 13 years ago on Friday September 17, 2010 | Permalink
  5. I think that could make my case, but is it possible to hide the email field ?

    Edit :
    I prefer that the user just see the thanks message directly instead of the form if the couple email/form id already exist (email field is a hidden field with a default value {user:user_email})

    Posted 13 years ago on Saturday September 18, 2010 | Permalink
  6. Well, i find a way. I use the limit of entries, setting to 1 for the form, and i have modify the code like this :

    In gravityforms/form_display.php

    Search :
    //If form has a limit of entries, check current entry count if($form["limitEntries"]) {

    Add after :
    global $user_login; get_currentuserinfo();

    Search :
    $entry_count = RGFormsModel::get_lead_count($form_id, '');
    Replace by :
    $entry_count = RGFormsModel::get_lead_count($form_id, $user_login);

    Et voilĂ  !

    This solution work only with registered users, but it is my case, i use Members plugin to limit access of the form to registered users.

    Posted 13 years ago on Sunday September 19, 2010 | Permalink
  7. I forget to say that you need to have in the form a hidden field with variable user_id ^^

    Posted 13 years ago on Monday September 20, 2010 | Permalink
  8. johnfaraca
    Member

    This code worked awesome! Thank you Marsius, it has helped me tremendous.

    Posted 13 years ago on Sunday October 10, 2010 | Permalink
  9. Many thanks Marsius. Was struggling with this forever.

    Posted 13 years ago on Thursday December 2, 2010 | Permalink
  10. Hmm this isn't working for me. What exactly do you need to put in the hidden field? I have tried putting user_id in the default value: insert variable field but this doesn't work for me.

    Posted 13 years ago on Sunday January 30, 2011 | Permalink
  11. Hi Dave,

    Here is an alternate solution that doesn't require any core modifications. Paste the following in your functions.php and update the the '28' in 'gform_pre_render_28' to the ID of your own form and should be good to go.

    http://pastie.org/1515124

    Posted 13 years ago on Monday January 31, 2011 | Permalink
  12. Thanks David, that works ... but ... I am using this on an intranet and everyone has the same IP. Is there a way to do this simply using a cookie?

    Posted 13 years ago on Tuesday February 1, 2011 | Permalink
  13. simbian
    Member

    Thanks i need it too and would use the David's great solution, but if i would set the limit to allow 1 submission per day? Next day the users should be able to use the form again.

    Simone

    Posted 12 years ago on Monday October 17, 2011 | Permalink
  14. simbian, please post a new topic for your issue. A lot of things have changed in the past 8 months.

    Posted 12 years ago on Tuesday October 18, 2011 | Permalink

This topic has been resolved and has been closed to new replies.