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.

Limit front end submissions based on User Role and Amount per x hour or days

  1. FanaticWeb
    Member

    First, I looked up this thread (http://www.gravityhelp.com/forums/topic/one-or-x-submissions-per-form-per-user) and with the arrival of GF V1.6, I understand that form submissions can be set to expire on a x amount of Hours/Days/Year.

    The problem I find with the Form submission limitations is that the form becomes obsolete after that given amount of time, so we have to either go back and create a new one or Disable the submission period limitations to allow further submissions in some cases.

    What I'm looking for is a bit more extended with some conditions to allow a more flexible pattern:
    1. User must be logged in (This is already implemented as of GF v1.6)
    2. User must meet a specific role in order to be allowed to submit (ex.: Contributors, Authors = yes, Subscribers, Guests = no)
    3. Limit form submissions per user Role (or even per username, whichever is easier to implement) ex.: 2 submissions allocated per x amount of time (be it Hour, Day, Month, Year), if exceeded, redirect to warning message.

    Any thoughts if this can be achieved and how to go by doing so?

    Posted 10 years ago on Saturday February 18, 2012 | Permalink
  2. Hi, FanaticWeb,

    This will require custom code to do, but you may be able to use the "gform_validation" hook (http://www.gravityhelp.com/documentation/page/Gform_validation). In this hook, you would need to query the database to see how many entries exist for role/username of the person filling out the current form and your desired time-frame and fail validation if the limit has been reached.

    You can take a look at the validate_entry_limit function in form_display.php to see how Gravity Forms checks the limit and the function get_limit_period_dates to see how the start/end dates are set.

    I hope this helps point you in the right direction.

    Posted 10 years ago on Wednesday February 29, 2012 | Permalink
  3. FanaticWeb
    Member

    Hi Dana, thanks for the feedback, your link didn't work but I believe you were referring to this one? http://www.gravityhelp.com/forums/topic/time-limit-to-fill-a-form#post-49728

    Bottom line, this definitely seems to require some extended coding, I had submitted a priority support ticket and Carl was able to provide me the feedback and tips on how to go around doing so using hooks such as the gform_pre_render and whatnot, unfortunately I'm not a coder, and as per my request, he referred me to third party coders that should be able to complete this mod, but personally I would prefer dealing with someone from the internal GF staff or the more advanced users on here to complete this mod (Compensated of course)

    I really wished it was something that could become native within GF, wishful thinking for now, nevertheless, thank you for getting back at me.

    P.S.: I did advise Carl of this post to avoid duplicate efforts, just saying :)

    Posted 10 years ago on Thursday March 1, 2012 | Permalink

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