Gravity Forms Discount Codes, Coupons & Promo Offers

Gravity Forms Shortcode Explanation

Since Gravity Forms allows the designed custom forms to be embedded in WordPress posts or pages, this has to be typically done via shortcodes.

The following are the tags that you can use as a combination to complete a form shortcode and embed the same into WordPress content (Please note that Gravity Forms can also be embedded on widgets or via specific function calls)

id: The ID of the form to be embedded. This is a required parameter.

title: Optional tag which takes ‘true’ or ‘false’ and indicates whether forms title has to be displayed. Default is ‘false’ which means, no title is displayed.

description: Another optional tag just like title. ‘false’ means no forms description is displayed.

ajax: It takes values ‘true’ or ‘false’ and indicates whether ajax is used to process form submit.

tabindex: Specifies the starting tab index for the fields of the embedded form.

A form shortcode example that has all the tags we just saw is given below:

[gravityform id=”3″ title=”false” description=”false” ajax=”true” tabindex=”100″]

Conditional shortcodes

In addition to any form shortcode, you could use the conditional shortcodes to display conditional messages (e.g. confirmation message, error messages due to wrong values in forms) or conditional form content (e.g. State selection when Country is selected)

The conditional shortcodes are explained via the following example:

[gravityforms action=”conditional” merge_tag=”{Country:5}” condition=”is” value=”United States”]
The form content to be displayed when United States is selected as the country. e.g. Display state selection
[/gravityforms]

The conditional shortcode tag explanation is given below:

action: This is always required and always takes value ‘conditional’ for conditional logic

merge_tag: This tag is required as well. It indicates the form merge tag against which the conditional value is checked.

condition: The logical condition that has to be checked. This is a required tag and the values it can take are: is, isnot, greater_than, less_than, contains, starts_with, ends_with

value: Another required field that indicates the value that’s checked against the merge_tag content in order to satisfy the condition.

,