Form Settings

Form Settings

Getting ThereSettings AreaSettings Sections Form BasicsForm LayoutForm ButtonSave and ContinueRestrictionsForm OptionsSave Settings

Getting There

Every form has its own group of settings. You can navigate to the Form Settings page a few different ways:

From within the Form List view, hover over the form you want to review and then click or hover on the Settings link that appears below. From within the Form Editor for a particular form, hover or click on the Settings option in the top bar.

Settings Area

The Settings area contain access to the many form specific areas of your form. Form Settings is the top most option. Note that the content of this left hand menu may vary based on which add-ons you have installed.

An example of some options available in the Settings area.

Settings Sections

Each setting option within the Form Settings page is described below, categorized into the sections they appear in.

Note that you can get a quick tooltip about a form settings by hovering over the (?) 「what is this」 button on the settings page for a short tooltip.

Form Basics

These are the basic fields entered when you created your form.

TitleEnter the title of your form. This will be helpful when you need to find it in the forms list.

DescriptionEnter a description for your form. This may be used for user instructions.

Form Layout

Label PlacementThis defines where your field labels will appear, relative to the position of the input area of the field. Top aligned is above the field, left aligned is and right aligned to that respective side of the field.

Description PlacementSelect the description placement. Descriptions can be placed above the field inputs or below the field inputs. Only available when Label Placement is set to 「Top aligned」. This setting can be overridden by field specific settings.

Sub-Label PlacementDetermines the placement of the sub-label. This setting can be overridden by field specific settings.

Validation SummaryIf enabled, will show a summary that lists form validation errors at the top of the form when a user attempts a failed submission.

Required Field IndicatorDetermines how you wish to indicate a required field. Options include the text 「(required)」, an asterisk only, or a customer indicator where you can define the text to be displayed.

CSS Class NameEnter the CSS class name you would like to use in order to override the default styles for this form.

Form Button

This section defines the options available to manipulate the appearance of the button used to submit your form.

Input TypeSelect either:Text: type in what you would like to appear as the button text. Image: to use an image as the button, select Image and enter the full path to the image you would like to use.

Conditional LogicThis option allows you to create rules to dynamically display or hide the submit button based on values from a field. Refer to this article for more on conditional logic.

Note that hiding the submit button can cause usability issues, which can negatively affect the accessibility of your form.

Save and Continue

This checkbox allows you to enable a button in which the user can save their progress and continue at a later time. See this article more information on Save and Continue.

Restrictions

Limit number of entriesEnter a number in the input box below to limit the number of entries allowed for this form. The form will become inactive when that number is reached.

Schedule formSchedule a time period the form is active. Checking this option also provides additional inputs for the Start Date and Time and End Date and time for the form schedule, along with Pending Message and Expired Message to display when the form is waiting to be displayed and after it has expired.

Require user to be logged inCheck this option to require a user to be logged in to view this form.

Require login messageEnter a message to be displayed to users who are not logged in. Shortcodes and HTML are allowed in this message so you can use a shortcode to call another form.

Form Options

Enable anti-spam honeypotChecking this option will enable the honeypot spam protection technique, which is an alternative to the reCAPTCHA field. Once activated, the honeypot spam protection technique will function automatically and will not require any user interaction. Form submissions caught by the honeypot protection are not saved, but the form confirmation is processed as usual.

Enable Animated transitionsChecking this option will enable a sliding animation when displaying/hiding conditional logic fields. By default, the displaying/hiding of conditional logic fields has no animation; the fields are displayed/hidden instantly.

Enable legacy markupTurning this option on will revert to pre-2.5 markup for your form. This option is enabled by default for forms that existed prior to you upgrading to 2.5. This option is off for all new forms.

Save Settings

Don』t forget to click Save Settings once you are done to commit your form setting changes.

Common Issues With Formatting

Common Issues With Formatting

Why aren』t my form styles being loaded properly?Why is my form showing up with list bullets?How do I align my form fields into columns?Why does the word 「none」 appear next to my form inputs in IE?

Why aren』t my form styles being loaded properly?
Most of the time this is due to embedding the form via the php function call directly into the theme files or into a third-party widget. When embedding the form via this method, you also have to manually enqueue the CSS and scripts required for the forms to display and function properly.
You can find more information on this topic in the documentation here:

Embedding a Form
gravity_form_enqueue_scripts

Why is my form showing up with list bullets?
This is usually due to the form inheriting styles from your theme. You can add the following CSS declaration to your theme stylesheet and it should remove the bullet styling plus any stray borders that appear on occasion.
body .gform_wrapper form .gform_body ul,
body .gform_wrapper form .gform_body ul li {
list-style-type: none !important;
list-style-image: none !important;
list-style: none !important;
background-image: none !important;
background: none !important;
padding: 0 !important;
margin: 0 !important;
border: none !important
}
body .gform_wrapper form .gform_body ul > li:before {
content: "";
}

How do I align my form fields into columns?
Gravity Forms includes several 「helper」 CSS classes we call CSS Ready Classes. They allow you to easily create column style layouts without having to write custom CSS rules.
You can find out more about these classes in the CSS Ready Classes article.
Why does the word 「none」 appear next to my form inputs in IE?
We have seen this several times and it has always been related to the usage of the DDBelatedPNG.js script. This script was designed to add transparent PNG image support for IE6. Both IE6 and the DDBelatedPNG script are at the end of life and therefore the script shouldn』t be necessary any longer. Removing the script reference from the page solves the issue.

Setting Up the FreshBooks Add-On

Setting Up the FreshBooks Add-On

Pre-RequisitesSetup

Note: As of September 2016, FreshBooks has released a new version of their service. Currently, the Gravity Forms FreshBooks Add-On only works with the previous Freshbooks Classic version and will not work with their updated API.
Pre-Requisites

Download and install the add-on
A FreshBooks account

Please note that when using the FreshBooks Add-On you are limited to the capabilities of the FreshBooks account you have signed up for. Limitations include the number of clients you can create, so be sure to have a FreshBooks account that will be able to handle the level of integration you choose to implement.
Setup

Log into your WordPress admin dashboard.
On the left side navigation menu, hover over Forms and click on Settings.
From this page, click the FreshBooks tab.
Enter your Site Name and Authorization Token. If you need help finding this, refer to the Obtaining and Saving your FreshBooks API Credentials article.
Click Update Settings. If you』ve entered your account information correctly, you will be notified by green check marks beside each box. If you do not see green check marks, please double check this information and try again.

Once you have entered your API key, you』re ready to begin creating a feed for the FreshBooks Add-On.

FreshBooks Change Log

FreshBooks Change Log

2.8 | 2021-05-072.7 | 2020-04-212.6 | 2019-08-072.5 | 2017-04-282.4 | 2016-12-062.3.1 | 2016-11-302.3 | 2016-08-312.2 | 2015-04-202.1 | 2015-02-262.0 | 2014-12-151.4.41.4.3 | 2013-06-211.4.2 | 2013-05-221.4.1 | 2013-05-221.4 | 2013-03-071.3 | 2012-06-271.2 | 2012-02-071.1 | 2010-12-151.0 | 2010-12-15

2.8 | 2021-05-07

Added a form settings menu icon for Gravity Forms 2.5.

2.7 | 2020-04-21

Added translations for Hebrew, Hindi, Japanese, and Turkish.
Fixed notices which occur with PHP 7.4 when the add-on settings are not configured.

2.6 | 2019-08-07

Added security enhancements.
Added License GPL to the plugin header.
Updated Plugin URI and Author URI to https in plugin header.
Fixed a PHP notice which would occur when sending a request to Freshbooks.
Removed temporary plugin page.

2.5 | 2017-04-28

Added security enhancements.
Added translations.

2.4 | 2016-12-06

Renamed to Freshbooks Classic.

2.3.1 | 2016-11-30

Fixed strings for translations.

2.3 | 2016-08-31

Added $feed as the fourth parameter of the gform_freshbooks_args_pre_create filter.
Added tax fields back in API code so the hook gform_freshbooks_args_pre_create can be used to pass tax names/percentages.
Fixed notices thrown in API code when tax fields do not exist.
Fixed an issue with the upgrade routine which caused it run even if a pre-framework version hadn't been installed.

2.2 | 2015-04-20

Fixed a low severity security vulnerability in the admin area which could be exploited by authenticated users with form administration permissions.

2.1 | 2015-02-26

Added option to mark invoice as Paid. Only available for Product and Services type payment feeds. When enabled and a compatible payment feed runs, if the payment is successfully completed, a payment will be created in Freshbooks, updating the invoice status to paid. sendByEmail will also be delayed until after the payment has been created.
Added note to entry upon successful invoice/estimate creation.
Added merge tag support to the client & invoice/estimate Notes.
Added the gform_freshbooks_args_pre_create filter so the invoice/estimate field values can be overridden.
add_filter( 'gform_freshbooks_args_pre_create', function ( $args, $form, $entry ) {
// do stuff with the $args
return $args;
}, 10, 3 );
Updated feed settings page so Client and Invoice/Estimate settings are organised into their own sections.
Updated gravityformsfreshbooks.pot.
Updated Organization so that it is not required when mapping fields (since Freshbooks does not require it).
Updated logging statements.

2.0 | 2014-12-15

Added validation to discount to make sure it is between 0 and 100 percent.
Added ability to have invoice automatically emailed to the client, instead of remaining in Draft status in FreshBooks.
Added text domain/path to header.
Updated PO Number to truncate at 25 characters because FreshBooks will not create an invoice/estimate if the value if more than 25 characters.
Updated "Update existing client" option to filter by email to improve performance.
Updated POT file.
Updated to send Item Name instead of Item ID when using Fixed Costs or Dynamic Fields. To continue sending the Item Id, use the hook:
add_filter( 'gform_freshbooks_send_item_id_for_fixed_dynamic', 'send_item_id' );
function send_item_id(){
return true;
}
Updated required version of Gravity Forms to 1.8.17.
Updated to not process entries marked as spam.
Updated to have the file class-gf-freshbooks.php and organized code into this file and freshbooks.php.
Integrated with Add-on Framework.

1.4.4

Fixed issue when returning more than 100 line items from Freshbooks.

1.4.3 | 2013-06-21

Increased line item page size.

1.4.2 | 2013-05-22

Fixed issue with pricing message being displayed even when pricing option isn't selected.

1.4.1 | 2013-05-22

Fixed issue with line item paging.
Fixed issue with default line item field mapping type.
Added hook to enable option for dynamic field mapping.
ex: add_filter("gform_freshbooks_enable_dynamic_field_mapping", __return_true);

1.4 | 2013-03-07

Updated AJAX URL to resolve conflict when site is running under SSL.
Fixed a notice message.

1.3 | 2012-06-27

Added new conditional logic options (greater than, less than, contains starts with, ends with) and support for other conditional fields.
Fixed notices.
Added support for logging.
Added support for Manage WP.

1.2 | 2012-02-07

Added support for pricing fields.
Fixed notices.
Fixed issue where RG_CURRENT_PAGE constant was not available when GF is deactivated.
Added "Cancel" button to Edit page.
Updated List page to display the correct message when user doesn't have any feeds configured.

1.1 | 2010-12-15

Fixed issue with automatic upgrade on WP 3.0.

1.0 | 2010-12-15

Fixed issue with export condition that was only accurate after save button was clicked.
Changed submit button label to "Save Feed" for new feeds and "Update Feed" for existing feeds.
Fixed issue with multiple feeds being created.

Freshbooks Feed Meta

Freshbooks Feed Meta

IntroductionUsagePropertiesInvoice/Estimate PropertiesFixed/Dynamic Line Items Properties

Introduction
The Feed Object meta for the Freshbooks add-on is an associative array containing the properties which determine how the add-on should process the form submission.
$feed['meta'] = array(
'feedName' => 'Your Feed Name',
'email' => '2',
'updateClient' => true,
'feed_condition_conditional_logic' => true,
'feed_condition_conditional_logic_object' => array(
'conditionalLogic' => array(),
),
);

Usage
We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:
$conditional_logic_enabled = rgars( $feed, 'meta/feed_condition_conditional_logic' );

Properties

feedName string
The feed name which appears on the add-ons feeds tab.

email string
The ID of the field containing the client』s email address.

updateClient boolean
Update an existing client if email addresses match.

firstName string
The ID of the field containing the client』s first name.

lastName string
The ID of the field containing the client』s last name.

organization string
The ID of the field containing the client』s organization.

address string
The ID of the field containing the client』s address.

phone string
The ID of the field containing the client』s phone number.

fax string
The ID of the field containing the client』s fax number.

notes string
The note which should be added to the client. Merge tags supported.

alsoCreate string
Should an invoice or estimate be created. Possible values: invoice, estimate or neither.

feed_condition_conditional_logic boolean
Is the feed condition (conditional logic) setting enabled. Default is false.

feed_condition_conditional_logic_object array
An associative array containing the conditional logic rules. See the Conditional Logic Object for more details.

Invoice/Estimate Properties

sendByEmail boolean
Should the invoice/estimate be automatically emailed to the client, instead of being left in Draft form.

createPayment boolean
Only applicable when creating an invoice and also using a payment add-on with a product transaction. Once the user has completed his/her payment transaction, a Freshbooks payment for the invoice amount will automatically be created, changing the invoice status to Paid.

poNumber string
The ID of the field containing the purchase order number.

discount integer
The discount percentage which should be applied to the total invoice/estimate cost.

lineItems string
Create one or more line item(s) for your invoice or estimate. Possible values: fixed, pricing or dynamic.

notes2 string
The note which should be added to the invoice or estimate. Merge tags supported.

terms string
The terms which should be added to the invoice or estimate.

Fixed/Dynamic Line Items Properties

item array
An indexed array containing the Freshbooks item ids for each line item.

description array
An indexed array containing the description for each line item.

cost array
An indexed array containing the cost for each line item. With lineItems set to dynamic this would contain a field ID instead.

quantity array
An indexed array containing the quantity for each line item. With lineItems set to dynamic this would contain a field ID instead.

gaddon_no_output_field_properties

gaddon_no_output_field_properties

DescriptionUsageParametersPlacementSource Code

Description
Some non-standard HTML properties are not output to the field HTML by default. This filter allows you to allow or deny specific properties to be added to the field HTML.
Usage
The following would apply to all forms.
1add_filter( 'gaddon_no_output_field_properties', 'your_function_name' );

Parameters

$properties array
Array of properties not allowed.

$field Form Object
The current field meta to be parsed.

Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in class-gf-addon.php.

General Tab

General Tab

IntroductionSettingsSource Code

Introduction
The following settings are available for use on a field』s General tab. The gform_field_standard_settings hook can also be used to add custom settings at the positions indicated below.
Settings can be enabled for a field which extends the GF_Field class by overriding the get_form_editor_field_settings() method.
Settings

Position: 0

label_setting
The Field Label setting allows the user to define a label for the field.

Position: 10

description_setting
The Description setting allows the user to define the field description.

Position: 20

product_field_setting
The Product Field Mapping setting allows the user to select which Product field the current Option field is associated with.

Position: 25

product_field_type_setting
The Field Type setting allowing the product field to be set to a specific type: Single Product, Drop Down, Radio Buttons, User Defined Price, Hidden, or Calculation.

Position: 37

shipping_field_type_setting
The Field Type setting allowing the Shipping field to be set to a specific type: Single Method, Drop Down, Radio Button.

Position: 50

base_price_setting
The Price setting allows the user to specify the product』s base price.

Position: 75

disable_quantity_setting
The Disable quantity field setting allows the user to remove the quantity input from the field displayed on the front-end. A default value of 1 will be used, unless a separate Quantity field is added.

Position: 100

option_field_type_setting
The Field Type setting allowing the Option field to be set to a specific type: Drop Down, Checkboxes, or Radio Buttons.

Position: 125

donation_field_type_setting – Deprecated
The Field Type setting allowing the donation field to be set to a specific type: Drop Down, Radio Buttons, or User Defined Price.

Position: 150

quantity_field_type_setting
The Field Type setting allowing the quantity field to be set to a specific type: Number, Drop Down, or Hidden.

Position: 200

content_setting
The Content setting allows the user to enter HTML or text to be displayed for the field.

Position: 225

next_button_setting
The Next Button settings allow different button text or a custom image to be used for the button.

Position: 237

previous_button_setting
The Previous Button settings allow different button text or a custom image to be used for the button.

Position: 250

disable_margins_setting
The Disable default margins setting allows the content margins to be set to align the content with other fields.

Position: 300

post_custom_field_type_setting
The Field Type setting allowing the Post Custom field to be set to a specific type: Single line text, Paragraph Text, Drop Down, Multi Select, Number, Checkboxes, Radio Buttons, Hidden, Date, Time, Phone, Website, Email, File Upload, or List.

Position: 350

post_tag_type_setting
The Field Type setting allowing the Post tags field to be set to a specific type: Single line text, Drop Down, Checkboxes, or Radio Buttons.

Position: 400

captcha_type_setting
The Type setting allowing the Captcha field to be set to a specific type: reCAPTCHA, Really Simple CAPTCHA, or Math Challenge.

Position: 450

captcha_size_setting
The Size setting allowing the Captcha field size to be set to Small, Medium, or Large.

Position: 500

captcha_fg_setting
The Font Color setting allowing the Captcha fields font colour to be configured using a color picker or by entering the hex code.

Position: 550

captcha_bg_setting
The Background Color setting allowing the Captcha fields background colour to be configured using a color picker or by entering the hex code.

Position: 600

captcha_theme_setting
The Theme setting allow the Captcha fields theme to be set to light or dark.

Position: 650

post_custom_field_setting
The Custom Field Name setting allowing the user to specify which custom field the submitted value should be stored in.

Position: 700

post_status_setting
The Post Status setting allowing the user to specify what status the post created from the form submission should be assigned: Draft, Pending Review, or Published.

Position: 750

post_author_setting
The Default Post Author setting which determines which user should be set as the post author.

Position: 775

post_format_setting
The Post Format setting which can be used to specify which post format will be used for the post that is created by the form entry.

Position: 800

post_category_setting
The Post Category setting used to define which category the post created from the form submission should be assigned to.

Position: 825

post_category_field_type_setting
The Field Type setting allowing the Post Category field to be set to a specific type: Drop Down, Checkboxes, Radio Buttons, or Multi Select.

Position: 850

post_category_checkbox_setting
The Category setting defines which categories are available for selection by the user. They can choose to display all of them or select individual ones.

Position: 875

post_category_initial_item_setting
The Display placeholder settings enables a placeholder to be configured for the Post Category field.

Position: 900

post_content_template_setting
The Create content template setting provides a way for a template to be defined for the post content.

Position: 950

post_title_template_setting
The Create content template setting provides a way for a template to be defined for the post title.

Position: 975

customfield_content_template_setting
The Create content template setting provides a way for a template to be defined for the post custom field.

Position: 1000

post_image_setting
The Image Metadata settings are used to enable inputs for the image title, caption and description on the Post Image field.

Position: 1025

post_image_featured_image
The Set as Featured Image setting allows the file uploaded via the Post Image field to be set as the post』s featured image.

Position: 1050

address_setting
This includes the Address Type setting, input sub-labels, the ability to show/hide the individual inputs, Default Country (if International type is chosen), Default State (if United States is chosen), Default Province (if Canadian is chosen).

Position: 1100

name_format_setting – Deprecated
The Name Format setting provides the ability to change the Name field configuration from advanced to extended.

Position: 1125

name_setting
The Name Fields settings allow the individual field inputs to be enabled/disabled and the sub-labels configured.

Position: 1150

date_input_type_setting
The Date Input Type setting provides a drop down allowing the field to be configured as Date Field, Date Picker, or Date Drop Down.

Position: 1200

date_format_setting
The Date Format setting provides a list of available date formats from which to choose.

Position: 1225

customize_inputs_setting
The Customize Fields settings provide a way to customize the input sub-labels and enabled/disable the inputs.

Position: 1250

file_extensions_setting
The Allowed file extensions setting allows the file extensions which can be uploaded via the file upload field to be restricted.

Position: 1260

multiple_files_setting
The Enable Multi-File Upload setting determines if the field should use a single file type input or if the plupload scripts should be used to enable multiple files to be uploaded. When enabled you will also be able to limit the number of files which can be uploaded using the field.

Position: 1267

file_size_setting
The Maximum File Size setting enables the size of files uploaded using the File Upload field to be limited.

Position: 1275

columns_setting
The Enable multiple columns setting is used with the List field to allow multiple columns to be configured instead of the default single column.

Position: 1287

maxrows_setting
The Maximum Rows setting enables the number of rows the user can dynamically add to the front-end List field to be limited.

Position: 1300

time_format_setting
The Time Format setting allows the field to be set to use the 12 or 24 hour format.

Position: 1325

phone_format_setting
The Phone Format setting allows the Phone field format to be configured. The default formats are (###) ###-#### (standard) and International. The gform_phone_formats filter can be used to add additional formats.

Position: 1350

choices_setting
This setting allows you to customize the fields available choices, their values and if relevant their prices. It also allows you to choose from a predefined set of data. Without this section, the field is limited to the default choices of 「First Choice」, 「Second Choice」 and 「Third Choice」.

Position: 1362

other_choice_setting
The Enable 「other」 choice setting can be used to add a final choice to the radio button field with a text input allowing the user to enter their own custom choice text.

Position: 1368

email_confirm_setting
The Enable Email Confirmation setting allows a second email input to be displayed for confirmation, and also allows custom labels to be configured for each input.

Position: 1375

password_strength_setting
The Enable Password Strength setting enables a drop down to be displayed allowing the password fields minimum strength to be set.

Position: 1387

The Password fields Minimum Strength drop down will be located here.

Position: 1400

number_format_setting
The Number Format setting provides a drop down allowing the format to be set to decimal_dot, decimal_comma, or currency.

Position: 1415

sub_labels_setting
The Sub-Labels setting enables the labels for the fields individual inputs to be configured.

Position: 1425

Position: 1430

credit_card_setting
The Supported Credit Cards setting provides checkboxes for each of the available credit card types allowing the field validation to be configured to only allow certain types.

Position: 1435

credit_card_style_setting
The Card Icon Style setting provides a drop down allowing the icon style to be set to use the standard icons or the 3D icons.

Position: 1440

input_mask_setting
The Input Mask setting allows you to provide a visual guide allowing users to more easily enter data in a specific format such as dates and phone numbers.

Position: 1450

maxlen_setting
The Maximum Characters setting allows you to limit the maximum number of characters which can be entered in a text input or textarea.

Position: 1500

range_setting
The Range setting provides inputs allowing the minimum and maximum values for a number field to be defined.

Position: 1550

calculation_setting
This setting provides a way to enable calculation support for the field and the calculation formula to be defined.

Position: 1600

rules_setting
The Rules settings allow the field to be set as required and the duplicate_setting to be made available.

duplicate_setting
The No Duplicates setting allows the no duplicates validation to be enabled for the field.

Position: -1

Source Code
The above settings are located in GFFormDetail::forms_page() in form_detail.php.

Common Questions About Gravity Forms

Common Questions About Gravity Forms

What is Gravity Forms?What are the requirements to run Gravity Forms?Where can I get custom development?Do you have a trial version?How can I submit a feature request? When will you have feature X?Where do I put custom CSS and PHP?Does Gravity Forms work properly on Microsoft Internet Explorer?Will Gravity Forms work with my Theme?

What is Gravity Forms?
Gravity Forms is a plugin for WordPress. It allows you to quickly create data collection forms, polls and surveys for your WordPress website. This article explains more, or refer to our home page.
What are the requirements to run Gravity Forms?
Refer to this article.
Please note: If your site is hosted by the WordPress.com service you will need to be on their Business plan, with a custom domain configured and the Hello Dolly plugin installed, before they will allow you to install Gravity Forms.
Where can I get custom development?
Check out this article.
Do you have a trial version?
We do not have any trial version, but we do offer the following resources to help interested prospective purchasers:
– full user documentation
– a fully-functioning online demo
– reviewable Terms of Service
– a talented team of Support Engineers via our contact us form.
How can I submit a feature request? When will you have feature X?
We have a selection of proposed features that are either open for comment or voting to all active Gravity Forms license holders. Go to Gravity Forms Support page, and then choose 「View Our Roadmap」 to navigate to the Feature Roadmap page.
You can vote or comment on ideas listed there, or raise your own request via the (+) button at the bottom right.
Where do I put custom CSS and PHP?
Custom CSS rules for your forms belong at the end of your theme stylesheet. Action hooks and filters belong in your theme』s functions.php file. You can find more information in the documentation section here: https://docs.gravityforms.com/page/Where-Do-I-Put-This-Code
Does Gravity Forms work properly on Microsoft Internet Explorer?
Browser support for viewing WordPress pages is covered here. Internet Explorer will be no longer supported by Microsoft in 2021, and we will stop testing core and add-on updates on IE11 at that time.
Will Gravity Forms work with my Theme?
We can』t ensure that Gravity Forms will work with all available themes for WordPress. We code Gravity Forms using WordPress best practices and can ensure that Gravity Forms works with the latest Twenty * themes (Twenty Nineteen, Twenty Twenty, etc.) from Automattic.
Any theme which follows WordPress best practices should be fine. However, if there is an issue when using Gravity Forms with your theme, we will ask you to activate a default WordPress theme (one of the Twenty * themes) and see if the issue persists. If it does not, you will need to contact the author of your theme for troubleshooting.

generic_map Field

generic_map Field

IntroductionParametersExampleValidationHelpersget_generic_map_fields()Uses

Introduction

The generic_map field type, part of the Settings API, allows the user to map custom keys to custom values, based on submission or other data. It differs from the Dynamic Field Map in that it allows custom options to be defined for the mapping/value field. It allows fields to be mapped to data other than form fields. 

Parameters

name stringRequired. Name of the field. Use it to retrieve saved data.label stringRequired. Field label. Will be displayed in the UI.type stringRequired. Field type. Must be set to dynamic_field_map for the Dynamic Field Map field.tooltip stringOptional. Defaults to blank (no tooltip). Displays a question mark icon and a tooltip next to the field label.limit intOptional. Defaults to no limit. Defines the number of fields that can be mapped by the user.field_types arrayOptional. Defaults to empty (no filtering). Array of form field types to be available as options when mapping to this field. Only form fields of the specified types will be included in the list of fieldsExample:   array( 『text』, 『name』 )exclude_field_types arrayOptional. Defaults to empty (no filtering). Array of form field types to be excluded when mapping to this field.Example: array( 『creditcard』 )

key_field arrayOptional. Defaults to empty. By default, the Generic Map field presents users with an open text field for the key field, allowing them to enter a custom value.The key_field property allows the Key field to be presented as a drop down list, where users can select from a set of predefined choices.key_field array properties:title stringOptional. Defaults to the word 「Key」. Title that is displayed as a header for the key field column.allow_custom boolOptional. Defaults to true. Allows users to enter a custom key that is not in the drop down list.placeholder stringOptional. Defaults to blank. Placeholder displayed in the custom field text input. Only applies when custom fields are enabled (i.e. allow_custom=true).allow_duplicates boolOptional. Defaults to false. Controls whether or not the same option in the key field can be mapped multiple times. Note: This only prevents options from being selected multiple times in the drop down. If custom keys are enabled, users won』t be prevented from typing the same custom option multiple times.choices arrayOptional. Defaults to empty. Defines the items/keys to be added to the key field drop down.Each item of the choices array has the following properties:tooltip stringRequired. Choice label that is displayed in the drop down.value stringOptional. Defaults to the Label text. Value that is savedchoices arrayOptional. Defaults to empty.Creates an option group in the drop down. The label property becomes the Option Group label and the choices defined here become the options under the new group.Each item of the inner choices array has the following properties:label stringRequired. Choice label that is displayed in the drop down.value stringOptional. Defaults to the Label text. Value that is saved.value_field arrayOptional. Defaults to empty. Configures the fields in the right column (value fields). When this array is empty or not specified, the value drop downs will default to displaying the form related data (i.e. form fields and entry data)Each item of the value_field array has the following properties:title stringOptional. Defaults to the word 「Value」. Title that is displayed as a header for the value field column.allow_custom boolOptional. Defaults to true. Allows users to enter a custom value that is not in the drop down list.placeholder stringOptional. Defaults to blank. Placeholder displayed in the custom field text input. Only applies when custom fields are enabled (i.e. allow_custom=true).

choices arrayOptional. Defaults to empty. Defines the items to be added to the value field drop down.Each item of the choices array has the following properties:label stringRequired. Choice label that is displayed in the drop down.value stringOptional. Defaults to the Label text. Value that is saved.choices arrayOptional. Defaults to empty. Creates an option group in the drop down. The Label property becomes the Option Group label and the choices defined here become the options under the new group.Each item of the inner choices array has the following properties:label stringRequired. Choice label that is displayed in the drop down.value stringOptional. Defaults to the Label text. Value that is saved.validation_callback (function)Optional. Defaults to nothing (no callback). Calls a function during validation allow for custom validation logic. The example in the existing documentation page is good.

Example

The following example shows how you can allow the user to define a number of custom keys and map them to custom values, which in this case is limited to twenty. We are also excluding the creditcard field from the drop downs which contain the form fields as choices.

12345678910111213141516171819array(    'title'  => esc_html__( 'This is the title for Section 1', 'sometextdomain' ),    'fields' => array(        array(            'name'      => 'metaData',            'type'      => 'generic_map',            'label'     => esc_html__( 'Example', 'sometextdomain' ),            'key_field' => array(                'title' => 'Key Field',                'type'  => 'text',            ),            'value_field' => array(                'title' => 'Value Field',                'text'  => 'text',            ),            'validation_callback' => array( $this, 'validate_custom_meta' ),        ),    ),),

Validation

In the above example a validation callback is also specified to ensure that the limit is not exceeded and that the custom keys don』t exceed the character limit defined by the third-party service.

123456789101112131415161718192021222324252627282930public function validate_custom_meta( $field ) {    //Number of keys is limited to 20 - interface should control this, validating just in case    //key names can only be max of 40 characters      $settings = $this->get_posted_settings();    $metaData = $settings['metaData'];      if ( empty( $metaData ) ) {        return;    }      //check the number of items in metadata array    $metaCount = count( $metaData );    if ( $metaCount > 20 ) {        $this->set_field_error( array( esc_html__( 'You may only have 20 custom keys.' ), 'sometextdomain' ) );          return;    }      //loop through metaData and check the key name length (custom_key)    foreach ( $metaData as $meta ) {        if ( empty( $meta['custom_key'] ) && ! empty( $meta['value'] ) ) {            $this->set_field_error( array( 'name' => 'metaData' ), esc_html__( "A field has been mapped to a custom key without a name. Please enter a name for the custom key, remove the metadata item, or return the corresponding drop down to 'Select a Field'.", 'sometextdomain' ) );            break;        } elseif ( strlen( $meta['custom_key'] ) > 40 ) {            $this->set_field_error( array( 'name' => 'metaData' ), sprintf( esc_html__( 'The name of custom key %s is too long. Please shorten this to 40 characters or less.', 'sometextdomain' ), $meta['custom_key'] ) );            break;        }    }}

Helpers

The following functions may come in helpful when interacting with the generic_map field type during feed processing.

get_generic_map_fields()

Retrieves the individual field_map fields from the meta property of the Feed Object for the supplied field name.

1$metaData = $this->get_generic_map_fields( $feed, 'metaData' );

$feed Feed Object
Feed object or settings array.

$field_name string
The name property of the generic_map field to retrieve the mapped fields for.

$form array
Form object. Defaults to empty array.

$entry array
Entry object. Defaults to empty array.

Uses

settings_generic_map