Skip to documentation content

Form Submit

Form Submit

The form submit object and methods for form submission.

{{ form_submit }}

Properties
Properties of {{ form_submit }} objects
Name Type Description
object_type string Will always be form_submit
is_valid boolean True if this references a published form_submit
guid string The unique identifier for this form_submit
value string Contains the same value as guid
form_guid string The unique identifier of the form that was submitted
form {{ form }} Reference to the form that was submitted
submission_url string Full URL where the form was submitted from
date_submitted {{ time }} The date and time when the form was submitted
field_id string The identifier for this field
label string The label for this field
output string The default output that the form_submit produces when output directly to the template. The default output may change at any time. Template developers should avoid using this and should handle the output of form submissions themselves
Example Load one form_submit and show its form and date_submitted{% form_submit %} loads a single submission by GUID; form and date_submitted identify the parent form and when it was received.
Liquid
{%- form_submit var entry = "6f9619ff-8b86-d011-b42d-00cf4fc964ff" -%}
{%- if entry.is_valid -%}
	<p>Submission to {{ entry.form.linked_title }} on {{ entry.date_submitted | date: "MMMM d, yyyy h:mm tt" }}</p>
	<p>Posted to {{ entry.submission_url }}</p>
{%- endif -%}

{% form_submit %}

Has no name lookup: it takes a form_submit object or the GUID of one.

{% form_submit output_to_template? [[var, set, or assign]? variable_name]? output_to_template? = value %}
Parameters
output_to_template optionalflag
Include this flag to write the form_submit's output into the page at this point. What that output is differs by type, and for most types it is a built-in default that may change at any time, so see the output property of the form_submit object before relying on it. The flag may come before or after the variable name. When the call names no variable, the output is written whether or not the flag is present, which makes {% form_submit = value %} the smallest valid use of this method. When the call names a variable, the flag saves the form_submit to the variable and writes its output as well.
var, set, or assign optionalkeyword
Chooses the scope that holds the variable. var, the default, stores it in the current scope. set and assign can store it in outer scopes; Variable Scopes compares the three and when each fits.
variable_name optionalvariable
The variable that receives the form_submit. It may also be written as a reference, &name, which reads the variable's name from another variable (see Methods Overview). Leave it out to write the form_submit to the template instead.
value requiredexpression
Required; without a value the method call is not valid. Identifies which form_submit to fetch. It can evaluate to the form_submit itself, to its GUID, or to other text that identifies it, which for most types is its name; a type identified some other way, or only by GUID, says so in its summary. Names are matched without regard to case, but accented letters must match. A GUID identifies exactly one record, whereas when several records share a name, which of them is returned is not specified, so giving the records you fetch by name unique names avoids the question. A name reads better in a template and a GUID is exact; neither suits every site. When nothing matches, no error is raised: the variable holds an invalid form_submit, whose is_valid is false, so check is_valid before using it. When the expression itself has no value, for example an undefined variable, the method does nothing and the variable keeps any earlier value. May use liquid filters.

Fetches a single {{ form_submit }}.

Example Load one form_submit and show its form and date_submitted{% form_submit %} loads a single submission by GUID; form and date_submitted identify the parent form and when it was received.
Liquid
{%- form_submit var entry = "6f9619ff-8b86-d011-b42d-00cf4fc964ff" -%}
{%- if entry.is_valid -%}
	<p>Submission to {{ entry.form.linked_title }} on {{ entry.date_submitted | date: "MMMM d, yyyy h:mm tt" }}</p>
	<p>Posted to {{ entry.submission_url }}</p>
{%- endif -%}