Skip to main content

Settings objectNew in 5.0+

The Settings object allows you to access all of the form's settings assigned to it in the form builder.

​Properties

​name

Outputs the name of the form.

​handle

Outputs the handle of the form.

​type

The type of form, e.g. Solspace\Freeform\Form\Types\Regular.

​formattingTemplate

The formatting template assigned to the form inside the form builder, e.g. basic-dark/index.twig.

​description

Outputs the description of the form.

​color

Outputs the color hex for the form, e.g. #135BD7.

​submissionTitle

Outputs the submission title code (unparsed) configured in the form builder.

​storeData

A bool variable, which will be 1 if the form is set to store submitted data.

​defaultStatus

The default status ID to be assigned to new form submissions, e.g. 2.

​collectIpAddresses

A bool variable, which will be 1 if the form is set to collect IP addresses.

​allowUsersToOptIn

A bool variable, which will be 1 if the form is set to allow users to choose whether the form submission is saved to the database.

​optInCheckbox

The field name of the Opt-in Checkbox, if applicable.

​ajaxRenamed in 5.0+

A bool variable, which will be 1 if the form has the built-in AJAX setting enabled.

​focusFirstErrorNew in 5.17+

A boolean indicating whether Focus First Error After Submit is enabled. After validation fails, Freeform focuses the first visible field with an error, or the error banner when no field can be focused.

​showProcessingSpinnerRenamed in 5.0+

A bool variable, which will be 1 if the form has the Show Processing Indicator on Submit setting enabled.

​showProcessingTextRenamed in 5.0+

A bool variable, which will be 1 if the form has the Show Processing Text setting enabled.

​showProcessingOverlayNew in 5.17+

A boolean indicating whether Show Processing Overlay on Submit is enabled. The overlay dims the form and displays a centered spinner and processing message while the submission is being processed.

​processingTextImproved in 5.17+

The processing message configured in the form builder. Used by the submit button when Show Processing Text on Submit is enabled and by the overlay when Show Processing Overlay on Submit is enabled.

​successBehaviorImproved in 5.15+

The chosen behavior to happen after handling the successful submit of the form. Options are:

  • reload - Reload form with banner
  • load-success-template - Replace with success message
  • redirect-return-url - Redirect to another URL
  • redirect-entry — Redirect to a Craft entry.New in 5.15+

​returnUrl

Outputs the return URL configured for the form when using the Redirect to another URL success behavior.

​successTemplate

Outputs the success template configured for the form when using the Replace with success message success behavior, e.g. my-success-template.twig.

​successMessageImproved in 5.10.13+

Outputs the custom success message configured for the form when using the Reload form with banner success behavior.

Can be accessed directly as {{ form.successMessage }} instead of {{ form.settings.successMessage }}.

​errorMessageImproved in 5.10.13+

Outputs the custom error message configured for the form inside the form builder.

Can be accessed directly as {{ form.errorMessage }} instead of {{ form.settings.errorMessage }}.

​duplicateCheckRenamed and Revised in 5.0+

Outputs the option chosen for the Duplicate Check setting. You can run a conditional check on this with the following:

  • NULL: No restrictions (default)
  • no_limit_logged_in_users_only: Logged-in users — unlimited
  • once_per_logged_in_user_only: Logged-in users — once per form
  • once_per_email: Anyone — once per email
  • once_per_user_or_cookie: Anyone — once per user or cookie
  • once_per_user_or_ip_cookie: Anyone — once per user, IP, or cookie

​submissionLimitEnabled / submissionLimit / submissionLimitPeriod / submissionLimitMessageNew in 5.17+

The saved builder submission-limit settings, available as form.settings.submissionLimitEnabled, form.settings.submissionLimit, form.settings.submissionLimitPeriod, and form.settings.submissionLimitMessage. Defaults are false, 50, total, and “Submission limit reached”. Period values are total, day, week, month, or year.

These are the saved settings, rather than the effective values after template overrides. Use form.isSubmissionLimitReached(), form.submissionLimitCount, and form.submissionLimitMessage for runtime checks and translated output. See Limit Submissions.

​scheduleEnabledNew in 5.17+

Whether Schedule Form is enabled. Access as form.settings.scheduleEnabled. When disabled, saved start and end dates do not restrict availability.

​startSubmissionsAtNew in 5.17+

The Schedule Start Date, including the time, or null for immediate availability. Access as form.settings.startSubmissionsAt.

​stopSubmissionsAfter

The Schedule End Date, including the time, or null for no expiry. Access as form.settings.stopSubmissionsAfter or form.stopSubmissionsAfter. In Freeform versions before 5.17, this was labeled Stop Submissions After Date. Existing date-only cutoffs keep their end-of-day behavior.

​schedulePendingMessage / scheduleExpiredMessageNew in 5.17+

The configured pending and expired message text. For the translated message that applies right now, use form.scheduleMessage. See Form Scheduling for defaults and examples.