A newer version of

Freeform

is available.

Try Freeform 5 now →

Freeform Freeform for Craft

Overview

Submission Limits Pro

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 User Pro

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 only 4.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).

Templating 4.0.9+

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 submissionLimitReached (form object) as a conditional. It's a bool variable, which will be true if the form has the Limit Form Submission Rate setting enabled and the user has already submitted the form.




 
 











{# Replace 'myForm' with your form handle. #}
{% set form = craft.freeform.form("myForm") %}

{# Check if user has already submitted the form #}
{% if form.submissionLimitReached %}

    {# 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 %}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

Per Form Pro

Freeform includes the ability to set a limit on the maximum number of submissions a form may receive, and the reject any additional ones. 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 fForm 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 = craft.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 craft.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 {{ craft.freeform.submissionCount(form) }} submissions for this form.
    </p>

    {{ form.render({
        submissionLimit: submissionLimit,
    }) }}

{% endif %}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

Stop After Date

Inside the Validation tab (lock icon) in the form builder, an option exists to allow you to prevent new submissions of the form after the specified date.