Submission Limits Pro

If you need to set limits on the number of submissions a form may receive, a couple of 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 user can submit the form. Look for this setting:

  • Limit Form Submission Rate
    • Do not limit
    • Once per Cookie only
    • Once per IP/Cookie combo

Per Form Pro 3.12+

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.

The key is applying the submissionLimit parameter to the freeform.form function 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
Last Updated: 10/18/2021, 5:15:15 PM