Submission LimitsPro
If you need to set limits on the number of submissions a form may receive or who can submit the form, a few options are available:
Per UserPro
Inside the Validation tab (lock icon) in the form builder, an option exists to allow you to limit the number of times a specific user can submit the form. Look for this setting:
- Limit Form Submission Rate
- Do not limit
- Logged in Users only (no limit)
- Once per Cookie only
- Once per IP/Cookie combo
- Once per logged in Users only
- Once per logged in User or Guest Cookie only
- Once per logged in User or Guest IP/Cookie combo
- Once per Email Address only4.0.24+
- This will check any Email field type for a matching email address (across all Email fields if using more than one in the same form).
- Do not limit
Templating
Freeform includes validation to prevent duplicate submissions (when the user tries to submit the form again), but if you wish to prevent users from even being able to see the form (and display an error/notice in its place), you can use duplicate
(form object) as a conditional. It's a bool variable, which will be true
if the form has the Duplicate Check setting enabled and the user has already submitted the form.
{# Replace 'myForm' with your form handle. #}
{% set form = freeform.form("myForm") %}
{# Check if user has already submitted the form #}
{% if form.duplicate %}
{# Hide form and display error message #}
<p class="alert">You've already submitted this form!</p>
{% else %}
{# Display form if not yet submitted by the user #}
{{ form.render }}
{% endif %}
Per FormPro
Freeform includes the ability to set a limit on the maximum number of submissions a form may receive, and the reject any additional ones. This is a template-level feature. You can also include a template-based condition check and display an alternate message without ever presenting the form to the user in the event it's reached it's limit.
Templating
The key is applying the submissionLimit
parameter to the Form query and feeding it a number value. This could be hardcoded or you could grab this value from somewhere else such as another element or global variable, etc. Here's an example of what that may look like:
{# Replace 'myForm' with your form handle. #}
{% set form = freeform.form("myForm") %}
{# Specify the submission limit here (or grab this value from somewhere else such as another element or global variable, etc) #}
{% set submissionLimit = 50 %}
{# This optional conditional checks if the form has reached its submission limit set above #}
{% if freeform.submissionCount(form) >= submissionLimit %}
<p class="alert">Submission Limit Reached!</p>
{% else %}
<p class="notice">
This form has a limit of {{ submissionLimit }} submissions.
There are currently {{ freeform.submissionCount(form) }} submissions for this form.
</p>
{{ form.render({
submissionLimit: submissionLimit,
}) }}
{% endif %}
Stop After Date
Inside the Settings → Limits area in the form builder, a Stop Submissions After Date setting exists to allow you to prevent new submissions of the form after the specified date.