Form Tag

{exp:forms:form}

Parameters

Parameter Description
entry_id Entry ID of an Channel Entry. Use this parameter to grab the form linked to a specific entry.
url_title Same as entry_id=”” but now it with the entry’s url_title.
form_name Specify a specific form by using it’s form name.
display_error Allows you to specify how forms errors will be displayed.
return Allows you to define where the user will be returned after submitting the form. The parameter can be defined in two ways: Use the standard Template_Group/Template syntax to specify where to return the user. For instance, if you want the user to be returned to the “local” Template in the “news” Template Group, you would use: return=”news/local” Use a full URL. For example: return=”http://example.com/return.html“ If this parameter is not defined, they will be returned to the form page.
output_submit Disable the output of the submit button. Default is "yes".
queue_js Delays output of javascript if jQuery is not loaded yet. Used in conjunction with the {exp:forms:output_js} tag.
output_js Disable the output of the javascript. Default is "yes".
output_css Disable the output of the CSS. Default is "yes".
prefix This parameter allows you to change the default variable prefix used. This is especially useful when you are nesting tags to avoid variable collisions. Default is "forms".
fentry_id Adding this parameter with a valid form id will allow you to edit the submitted form.
fentry_hash Adding this parameter with a valid form hash will allow you to edit the submitted form.
ignore_ip This parameter will ignore the ip address if needed in a cached environment. Normally forms looks for a unique ip per form load. Options are yes/no. Default is no.

Variables

Variable Description
{forms:form_id} The internal Form ID.
{forms:label} The form label.
{forms:short_name} The form short name.
{forms:entry_id} The entry_id linked to this form (if any).
{forms:channel_id} The channel_id of the entry linked to this form (if any).
{forms:ee_field_id} The field_id of the entry linked to this form (if any).
{forms:member_id} The member_id of the member who created this form.
{forms:date_created} Creation date of this form.
{forms:date_last_entry} The date of the last entry submission.
{forms:total_entries} The total amount of submissions.
{forms:current_page} The current page number.
{forms:total_pages} The total amount of pages this form has.
{forms:paged} A simpel variable that outputs “yes” if the current form has multiple pages.
{forms:total_form_errors} The total amount of “Global” form submission errors.
{forms:total_field_errors} The total amount of “Field” related form submission errors.

Return Submission Variables

To show form submission data on a confirmation page you will need to send the form hash or fentry id in the submission. To do so you can add %FENTRY_HASH% or %FENTRY_ID% to the return parameter or submission flow. Example return="contact/thank-you/%FENTRY_HASH%/" would allow you to show submission data on the thank you page.

Variable Pairs

{forms:fields} Variable Pair Description
{forms:field} Renders the field.
{forms:field_type} The field type.
{forms:form_errors} Variable Pair Description
{forms:error} The error message.
{forms:error_count} The error count in the current loop.
{forms:error_type} The error type.

Conditionals

Conditional Description
{if forms:no_form} This tag will conditionally display the code inside the tag if no form was found.
{if forms:closed} This tag will conditionally display the code inside the tag if the form is closed.

Email Notification Override

These parameters allow you to override some email notification settings.

Type Description
notify_admin_from_name From Name
notify_admin_from_email From Email
notify_admin_cc Email CC (separate multiple by comma)
notify_admin_subject Email Subject
notify_admin_bcc Email BCC (separate multiple by comma)
notify_admin_replyto_name Reply-To Name
notify_admin_replyto_email Reply-To Email
notify_admin_replyto_author Set to “yes” to use submission author info
notify_user_from_name From Name
notify_user_from_email From Email
notify_user_cc Email CC (separate multiple by comma)
notify_user_subject Email Subject
notify_user_bcc Email BCC (separate multiple by comma)
notify_user_replyto_name Reply-To Name
notify_user_replyto_email Reply-To Email

Examples

There are two ways to display a form. Using a single tag or a tag pair. Difference? The tag pair version allows you to specify conditionals and style your multipage variables

Single Tag Version

1
{exp:forms:form form_name="untitled"}

Tag Pair Version

1
2
3
4
5
6
7
8
9
10
11
12
13
{exp:forms:form form_name="untitled"}
 
<h1>{forms:label}</h1>
{if forms:paged} <h3>Current Page: {forms:current_page} of {forms:total_pages}</h3>{/if}
 
{if forms:closed} FORM IS CLOSED! {/if}
{if forms:no_form} NO FORM FOUND! {/if}
 
{forms:fields}
        {forms:field}
{/forms:fields}
 
{/exp:forms:form}

Global Form Error Example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{exp:forms:form form_name="untitled"}
 
<h1>{forms:label}</h1>
{if forms:paged} <h3>Current Page: {forms:current_page} of {forms:total_pages}</h3>{/if}
 
{if "{forms:total_form_errors}" > 0}
<strong style="color:red">Sorry, the your submission contained some errors:</strong>
<ul>
        {forms:form_errors}
                <li>{forms:error}</li>
        {/forms:form_errors}
</ul>
{/if}
 
{if forms:closed} FORM IS CLOSED! {/if}
{if forms:no_form} NO FORM FOUND! {/if}
 
{forms:fields}
        {forms:field}
{/forms:fields}
 
{/exp:forms:form}
Forms

Getting Started