GF_Field_Date

GF_Field_Date

IntroductionSettings and PropertiesSettingsProperties$entry ValueUseful Methodscheckdate()get_value_entry_detail()HooksSource Code

Introduction

The GF_Field_Date class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Date field is rendered when the form is displayed and how its value is handled during and after form submission.

Settings and Properties

Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.

Properties contain the values specified by the settings and generally are part of the Field Object.

The properties may be retrieved by accessing the Field Object as follows:

//get the field
$field = GFFormsModel::get_field( $form, 1 );

//get the date type
$date_type = $field->dateType;

Settings

The following settings are available for the field:

admin_label_settingControls whether the 「Admin Field Label」 setting appears.conditional_logic_field_settingControls whether the 「Enable Conditional Logic」 setting appears.css_class_settingControls whether the 「Custom CSS Class」 setting displays. This allows a custom css to be used for the field.date_format_settingControls whether the 「Date Format」 setting displays. This provides a list of available formats from which to choose.date_input_type_settingControls whether the 「Date Input Type」 drop down appears. This allows the calendar selection to be set to a 「Date Field」, 「Date Picker」, 「Date Drop Down」.default_value_settingControls whether the 「Default Values」 section displays. This allows a value to be set for the field.description_settingControls whether the 「Description」 setting appears. This allows a description for the field to be displayed.duplicate_settingControls whether the 「No Duplicates」 setting displays within the 「Rules」 section. This controls whether the same value may exist more than once in the database. The 「Rules」 setting must be active for this to display.error_message_settingControls whether the 「Custom Validation Message」 setting which allows a custom message to be used appears.label_settingControls whether the 「Field Label」 setting which allows the label to be changed appears.placeholder_settingControls whether the 「Placeholders」 section appears. This allows placeholder text to display for the field.prepopulate_field_settingControls whether the 「Allow field to be populated dynamically」 setting appears.rules_settingControls whether the 「Rules」 settings section displays. The 「Required」 option shows when this is active.sub_label_placement_settingIf a field has sub-labels, controls whether the 「Sub-Label Placement」 setting appears.visibility_settingControls whether the 「Visibility」 setting displays. The controls whether the option of visibility being for 「Everyone」 or 「Admin Only」 can be set.

Properties

Below is a listing of the properties inherited from the parent class and ones specific to the Date field.

adminLabel stringThe label to be used on admin pages instead of the label, useful for fields with long labels.adminOnly booleanDetermines whether the field is visible to the user submitting the form, or only visible in the admin.allowsPrepopulate booleanDetermines if the field values can be dynamically populated. Default is false.calendarIconType stringUsed when the chosen date type is Date Picker and determines whether the user is presented with a small calendar icon, a custom small calendar icon, or no icon at all. Values are 「calendar」, 「none」, 「custom」.calendarIconUrl stringUsed when the chosen date type is Date Picker and the custom calendar icon is chosen. This indicates the path to the custom image being used as the icon.conditionalLogic arrayAn associative array containing the conditional logic rules. See the Conditional Logic Object for more details.cssClass stringThe custom CSS class or classes to be added to the input tag for the field.dateFormat stringThe chosen format of the date. Possible values are 「mdy」 (mm/dd/yyyy), 「dmy」 (dd/mm/yyyy), 「dmy_dash」 (dd-mm-yyyy), 「dmy_dot」 (dd.mm.yyyy), 「ymd_slash」 (yyyy/mm/dd), 「ymd_dash」 (yyyy-mm-dd), 「ymd_dot」 (yyyy.mm.dd) .dateType stringThe type of date field to display, from a simple date field, to a drop down, to a calendar picker. Values are 「datefield」, 「datedropdown」, 「datepicker」.description stringThe field description.descriptionPlacement stringThe placement of the field description. The description may be placed 「above」 or 「below」 the field inputs. If the placement is not specified, then the description placement setting for the Form Layout is used.errorMessage stringThe custom error message to be displayed if the field fails validation.formId integerThe form ID.id integerThe field ID.inputName stringThe parameter name used when dynamically populating the field. The parameter will be formatted depending on the date format chosen. For example, if the chosen format is MM/DD/YYYY, pass the parameter as 01/30/1971.inputs arrayAn array containing the the individual properties for each element of the date field. This array only available when dateType is 「datefield」 or 「datedropdown」.id integerThe id of the input field.label stringThe label for the input.customLabel stringThe custom label for the input. When set, this is used in place of the label.placeholder stringPlaceholder text to give the user a hint on how to fill out the field. This is not submitted with the form. For the website field, the text 「http://」 is displayed.defaultValue stringThe default value to be displayed in the input field.

$inputs = array(
array(
'id' => '1.1',
'label' => 'MM',
'name' => '',
'defaultValue' => '',
'placeholder => '',
'customLabel' => 'Month',
),
array(
'id' => '1.2',
'label' => 'DD',
'name' => '',
'defaultValue' => '',
'placeholder' => '',
'customLabel' => 'Day',
),
array(
'id' => '1.3',
'label' => 'YYYY',
'name' => '',
'defaultValue' => ''
'customLabel' => 'Year',
),
);

isRequired booleanMarking the field as required will prevent the form from being submitted if the user does not enter a value. Default is false.label stringThe field label that will be displayed on the form and on the admin pages.labelPlacement stringThe placement of the main field label 「Time」. The choices are top-aligned (top_label), left-aligned (left_label), right-aligned (right_label). To control the sub-label placement of the fields within the time group, use the 「subLabelPlacement」 property.noDuplicates booleanDetermines if the value entered by the user may already exist in the database.size stringControls the width of the input field. The choices are 「small」, 「medium」, and 「large」.subLabelPlacement stringThe placement of the labels for the fields (hours, minutes, am/pm) within the address group. This setting controls all of the time pieces, they cannot be set individually. They may be aligned above or below the inputs. If this property is not set, the 「Sub-Label Placement」 setting on the Form Settings->Form Layout page is used. If no setting is specified, the default is above inputs.type stringThe field type, which in this case is date.

$entry Value

The Date field value is not stored in the format configured on the field. The submitted value is reformatted during form submission by get_value_save_entry() so all Date fields are stored in the Entry Object in a consistent format, Y-m-d (i.e. 2016-05-21).

Useful Methods

GF_Field_Date inherits it』s available methods from GF_Field and overrides a few of them where necessary to provide its required appearance and functionality. Here are a few methods which can be useful when writing custom code.

checkdate()

The checkdate() method is used when validating the date field value by looking at the month, day, and year and verifying each piece is not empty, is numeric, and that the year is 4 digits.

Usage Example

$is_valid = $field->checkdate( $month, $day, $year );

$month integerTwo digit Month.$day integerTwo digit Day.$year integerFour digit Year.Returns booleanIndicates if the supplied values are valid.

get_value_entry_detail()

The get_value_entry_detail() method formats the entry value before it is used in notifications, confirmations, and the entry detail page. It can also be used in custom code to reformat the $entry value back to the date format specified when the field was configured.

Usage Examples

// if you have access to the $field object
$value = $field->get_value_entry_detail( $value );

// if you don't have access to the $field object but you do have the $form get the field first
$field = GFFormsModel::get_field( $form, $field_id );
$value = $field->get_value_entry_detail( $value );

$value stringThe serialized string to be formatted.$currency stringNot relevant to this field type. Default is an empty string.$use_text booleanNot relevant to this field type. Default is false.$format stringNot relevant to this field type. Default is html.$media stringNot relevant to this field type. Default is screen.Returns stringThe entry value formatted according to the date format setting on the field.

Hooks

The following hooks are located in GF_Field_Date:

gform_date_min_yeargform_date_max_year

Source Code

The source code is located in includes/fields/class-gf-field-date.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_Dropbox

GF_Field_Dropbox

IntroductionPropertiesDynamic PopulationCalculations SupportConditional Logic Support$entry ValueMerge TagsUseful Methodsget_value_export()Source Code

Introduction
The GF_Field_Dropbox class extends the GF_Field class, also known as the Field Object, it』s responsible for determining how the Dropbox Upload field is rendered when the form is displayed and how it』s value is handled during and after submission.

Properties
These are the properties used by the Dropbox Upload field, which can be found in the Field Object, available to many of the hooks throughout Gravity Forms and some add-ons.

type string
The field type, which in this case is dropbox.

id integer
The field ID.

label string
The field label that will be displayed on the form and on the admin pages.

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

isRequired boolean
Determines if the field requires the user to select a file for upload. Marking the field as required will prevent the form from being submitted if a file is not selected. Default is false.

errorMessage string
The custom error message to be displayed if the field fails validation.

labelPlacement string
The field label visibility. Empty when using the form defaults or a value of 『hidden_label』.

descriptionPlacement string
The field description position. Empty when using the form defaults, a value of 『below』 to position the description below the input container, or a value of 『above』 to position the description above the input container.

multiselect boolean
Allow multiple files to be selected? Default is false.

allowedExtensions string
A comma separated string of allowed file extensions. e.g. jpg,gif,png

formId integer
The ID of the form this field is located on.

pageNumber integer
The form page this field is located on. Default is 1.

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

description string
The field description.

cssClass string
The custom CSS class or classes to be added to the li tag that contains the field.

Dynamic Population
Unfortunately the Dropbox Upload field does not currently support dynamic population.
Calculations Support
Unfortunately the Dropbox Upload field can』t currently be used with calculations; we do have this on the feature request list.
Conditional Logic Support
Unfortunately you can』t configure conditional logic rules on other fields based on the Dropbox Upload field; we do have this on the feature request list.
$entry Value
The Dropbox Upload field stores file urls in the Entry Object as a string in the following format:
["https://www.dropbox.com/link-one","https://www.dropbox.com/link-two"]
When accessing the field value in the Entry Object you will most likely want to decode the above so you can do something with each url. Here』s an example:
12345$value = rgar( $entry, '3' );$files = json_decode( $value, true );foreach ( $files as $file ) {    // do something with the $file}
Merge Tags
The field merge tag available via the merge tag drop down in notifications and confirmations will return the field value. Each URL will be returned on it』s own line.
{[Field Label]:[field_id]} e.g. {Dropbox Upload:3}
The Dropbox Upload field does not have any modifiers for the field merge tag.
The {all_fields} merge tag will return an unordered HTML list. For each list item the filename will be wrapped in a HTML link. If the notification format is changed to text then the value returned will be identical to that returned when using the field merge tag.
Useful Methods
GF_Field_Dropbox inherits it』s available methods from GF_Field and overrides a few of them where necessary to provide its required appearance and functionality. Here are a few methods which can be useful when writing custom code.
get_value_export()
The get_value_export() method formats the entry value before it is used in entry exports and by framework add-ons that integrate with third-party services, however, you can use it in your custom code when interacting with the Form Object, Field Object and Entry Object.
Usage Examples
12345// if you have access to the $field object$value = $field->get_value_export( $entry ); // if you don't have access to the $field object$value = GF_Field_Dropbox::get_value_export( $entry, $input_id );

$entry Entry Object
The entry from which the field value should be retrieved. Required.

$input_id string
The ID of the field for which the value should be retrieved. Required when not using $field. Defaults to the $field->id property when not supplied.

Returns string
The file url. If the entry value contains multiple urls then they will be separated by a comma with a space either side e.g.
https://www.dropbox.com/link-one , https://www.dropbox.com/link-two

Source Code
The GF_Field_Dropbox class is located in includes/class-gf-field-dropbox.php in the Gravity Forms Dropbox Add-On folder of your sites plugins directory.
The GF_Field class is located in includes/fields/class-gf-field.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_Email

GF_Field_Email

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Email class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Email field is rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
12345//get the field$field = GFFormsModel::get_field( $form, 1 ); //get the admin label$admin_label = $field->adminLabel;
Settings
The following settings are available for the field:

admin_label_setting
Controls whether the 「Admin Field Label」 setting appears.

conditional_logic_field_setting
Controls whether the 「Enable Conditional Logic」 setting appears.

css_class_setting
Controls whether the 「Custom CSS Class」 setting displays. This allows a custom css to be used for the field.

default_value_setting
Controls whether the 「Default Values」 section displays. This allows a value to be set for the field.

description_setting
Controls whether the 「Description」 setting appears. This allows a description for the field to be displayed.

duplicate_setting
Controls whether the 「No Duplicates」 setting displays within the 「Rules」 section. This controls whether the same value may exist more than once in the database. The 「Rules」 setting must be active for this to display.

email_confirm_setting
Controls whether the 「Enable Email Confirmation」 section displays. This section allows a second email field to display for confirmation, and also allows custom labels for each field.

error_message_setting
Controls whether the 「Custom Validation Message」 setting which allows a custom message to be used appears.

label_setting
Controls whether the 「Field Label」 setting which allows the label to be changed appears.

placeholder_setting
Controls whether the 「Placeholders」 section appears. This allows placeholder text to display for the field.

prepopulate_field_setting
Controls whether the 「Allow field to be populated dynamically」 setting appears.

rules_setting
Controls whether the 「Rules」 settings section displays. The 「Required」 option shows when this is active.

size_setting
Controls whether the 「Field Size」 setting displays. This controls the size of the input field for fields to which it applies. The sizes are 「small」, 「medium」, and 「large」.

visibility_setting
Controls whether the 「Visibility」 setting displays. The controls whether the option of visibility being for 「Everyone」 or 「Admin Only」 can be set.

Properties
Below is a listing of the properties inherited from the parent class, and the properties unique to the field:

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

adminOnly boolean
Determines whether the field is visible to the user submitting the form, or only visible in the admin.

allowsPrepopulate boolean
Determines if the field values can be dynamically populated. Default is false.

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

cssClass string
The custom CSS class or classes to be added to the input tag for the field.

defaultValue string
The default value displayed in the field. This will be submitted with the form if not changed. If the 「Enable Email Confirmation」 option is checked, this property is not used. The 「defaultValue」 property that is part of the 「inputs」 array is used.

description string
The field description.

descriptionPlacement string
The placement of the field description. The description may be placed 「above」 or 「below」 the field inputs. If the placement is not specified, then the description placement setting for the Form Layout is used.

emailConfirmEnabled boolean
Determines whether the Confirm Email field is active.

errorMessage string
The custom error message to be displayed if the field fails validation.

formId integer
The form ID.

id integer
The field ID.

inputName string
The parameter name used when dynamically populating the field. The value will populate the Email field and the Confirm Email field if it is active.

inputs array
This array only exists when the Enable Email Confirmation (emailConfirmEnabled = true) option is checked. This array contains the individual properties for each element of the email and confirm email fields.

id integer
The id of the input field.

label string
The label for the input.

customLabel string
The custom label for the input. When set, this is used in place of the label.

placeholder string
Placeholder text to give the user a hint on how to fill out the field. This is not submitted with the form.

defaultValue string
The default value to be displayed in the input field.

12345678910111213141516$inputs = array(            array(              'id'           => '1',              'label'        => 'Email',              'customLabel'  => 'Email Address',              'placeholder'  => 'Enter your email address',              'defaultValue' => ''            ),            array(              'id'           => ' 1.2',              'label'        => 'Confirm Email',              'customLabel'  => 'Confirm Email Address',              'placeholder'  => 'Enter your email address again',              'defaultValue' => ''            )          );

isRequired boolean
Marking the field as required will prevent the form from being submitted if the user does not enter a value. Default is false.

label string
The field label that will be displayed on the form and on the admin pages.

noDuplicates boolean
Determines if the value entered by the user may already exist in the database.

placeholder string
Placeholder text to give the user a hint on how to fill out the field. This is not submitted with the form. If the 「Enable Email Confirmation」 option is checked, this property is not used. The 「placeholder」 property that is part of the 「inputs」 array is used.

size string
Controls the width of the input field. The choices are 「small」, 「medium」, and 「large」.

subLabelPlacement string
The placement of the labels for the email and confirm email fields. This setting controls both pieces, they cannot be set individually. They may be aligned above or below the inputs. If this property is not set, the 「Sub-Label Placement」 setting on the Form Settings->Form Layout page is used. If no setting is specified, the default is above inputs. This is only available when the Enable Email Confirmation setting is checked.

type string
The field type, which in this case is email.

Source Code
The source code is located in includes/fields/class-gf-field-email.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_FileUpload

GF_Field_FileUpload

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_FileUpload class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the File Upload field is rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
12345//get the field$field = GFFormsModel::get_field( $form, 1 ); //get the allowed extensions$extensions = $field->allowedExtensions;
Settings
The following settings are available for the field:

admin_label_setting
Controls whether the 「Admin Field Label」 setting appears.

conditional_logic_field_setting
Controls whether the 「Enable Conditional Logic」 setting appears.

css_class_setting
Controls whether the 「Custom CSS Class」 setting displays. This allows a custom css to be used for the field.

description_setting
Controls whether the 「Description」 setting appears. This allows a description for the field to be displayed.

error_message_setting
Controls whether the 「Custom Validation Message」 setting which allows a custom message to be used appears.

file_extensions_setting
Determines whether the 「Allowed file extensions」 section displays. This section allows the user to enter a comma-delimited list of file extensions which may be uploaded.

file_size_setting
Determines whether the 「Maximum File Size」 section displays. This section sets the allowed size for each file uploaded.

label_setting
Controls whether the 「Field Label」 setting which allows the label to be changed appears.

multiple_files_setting
Determines whether the 「Enable Multi-File Upload」 section displays. This section allows the interface to be changed to allow multiple files to be uploaded, instead of a single upload. This section also includes the ability to set a limit on how many files may be uploaded.

rules_setting
Controls whether the 「Rules」 settings section displays. The 「Required」 option shows when this is active.

visibility_setting
Controls whether the 「Visibility」 setting displays. The controls whether the option of visibility being for 「Everyone」 or 「Admin Only」 can be set.

Properties
Below is a listing of the properties inherited from the parent class, and the properties unique to the field.

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

adminOnly boolean
Determines whether the field is visible to the user submitting the form, or only visible in the admin.

allowedExtensions string
A comma-delimited list of the file extensions which may be uploaded.

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

cssClass string
The custom CSS class or classes to be added to the input tag for the field.

description string
The field description.

descriptionPlacement string
The placement of the field description. The description may be placed 「above」 or 「below」 the field inputs. If the placement is not specified, then the description placement setting for the Form Layout is used.

errorMessage string
The custom error message to be displayed if the field fails validation.

formId integer
The form ID.

id integer
The field ID.

isRequired boolean
Marking the field as required will prevent the form from being submitted if the user does not enter a value. Default is false.

label string
The field label that will be displayed on the form and on the admin pages.

maxFiles string
When the field is set to allow multiple files to be uploaded, this property is available to set a limit on how many may be uploaded.

maxFileSize integer
The maximum size an uploaded file may be.

multipleFiles boolean
Indicates whether multiple files may be uploaded and changes the interface accordingly.

type string
The field type, which in this case is fileupload.

Source Code
The source code is located in includes/fields/class-gf-field-fileupload.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_Hidden

GF_Field_Hidden

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Hidden class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Hidden field and the Hidden Quantity field are rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
//get the field
$field = GFFormsModel::get_field( $form, 1 );

//get the label
$label = $field->label;

Settings
The following settings are available for the field:

default_value_setting
Controls whether the 「Default Values」 section displays. This allows a value to be set for the field.

label_setting
Controls whether the 「Field Label」 setting which allows the label to be changed appears.

prepopulate_field_setting
Controls whether the 「Allow field to be populated dynamically」 setting appears.

Properties
Below is a listing of the properties inherited from the parent class, and the properties unique to the field:

allowsPrepopulate boolean
Determines if the field values can be dynamically populated. Default is false.

defaultValue string
The default value to be set in the field. If this is not changed, it is the value submitted.

formId integer
The form ID.

id integer
The field ID.

inputName string
The parameter name used when dynamically populating the field.

inputType string
This property is only available if this is a hidden Quantity field. The inputType will be set to hidden, while the type will be set to quantity.

label string
The field label that will be displayed on the form and on the admin pages.

productField integer
This property is only available if this is a hidden Quantity field. The id of the product field to which the field is associated.

type string
The field type. This is set to 「hidden」, unless this is a hidden Quantity field, then the type will be quantity.

Source Code
The source code is located in includes/fields/class-gf-field-hidden.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_HiddenProduct

GF_Field_HiddenProduct

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_HiddenProduct class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Product field is rendered when it is the 「Hidden」 selection when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
12345//get the field$field = GFFormsModel::get_field( $form, 1 ); //get the admin label$admin_label = $field->adminLabel;
Settings
The following settings are available for the field:

base_price_setting
Determines whether the 「Price」 section displays. This allows a base price to be specified for the product.

Properties
Below is a listing of the properties inherited from the parent class and ones specific to the field.

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

allowsPrepopulate boolean
Determines if the field values can be dynamically populated. Default is false.

basePrice string
The price of the product. The value includes the formatting characters.

description string
The field description.

descriptionPlacement string
The placement of the field description. The description may be placed 「above」 or 「below」 the field inputs. If the placement is not specified, then the description placement setting for the Form Layout is used.

formId integer
The form ID.

id integer
The field ID.

inputs array
An array containing the the individual properties for each element of the single product field.

id integer
The id of the input field.

label string
The label for the input.

name string
The name of the parameter used for the input when dynamically populating the field.

An example of the array output is as follows:
1234567891011121314151617$inputs = array(            array(              'id'    => '1.1',              'label' => 'Product Name',              'name'  => 'param_product'            ),            array(              'id'    => '1.2',              'label' => 'Price',              'name'  => 'param_price'            ),            array(              'id'    => '1.3',              'label' => 'Quantity',              'name'  => 'param_qty'            ),          )

inputType string
The sub-type of a field. For instance, when the field is a Product field, the 「type」 is set to product and the 「inputType」 is set to hiddenproduct. When the field is created, the type is initially set using the 「type」 property. If 「inputType」 is not empty, then the 「inputType」 is used to create the field instead.

label string
The field label that will be displayed on the form and on the admin pages.

type string
The field type. The type is set to product. The 「inputType」 is set to hiddenproduct.

Source Code
The source code is located in includes/fields/class-gf-field-hiddenproduct.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_HTML

GF_Field_HTML

IntroductionSettings and PropertiesSettingsProperties$entry ValueHooksSource Code

Introduction
The GF_Field_HTML class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the HTML field is rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
12345//get the field$field = GFFormsModel::get_field( $form, 1 ); //get the html content$content = $field->content;
Settings
The following settings are available for the field:

conditional_logic_field_setting
content_setting
css_class_setting
disable_margins_setting
label_setting

Properties
Below is a listing of the properties inherited from the parent class and ones specific to the field.

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

content string
The HTML/text that displays for the field.

cssClass string
The custom CSS class or classes to be added to the input tag for the field.

disableMargins boolean
Indicates whether the default margins are turned on to align the HTML content with other fields.

displayOnly boolean
Indicates the field is only displayed and its contents are not submitted with the form/saved with the entry. This is set to true.

formId integer
The form ID.

id integer
The field ID.

label string
The field label that will be displayed on the form and on the admin pages.

type string
The field type. This is set to 「html」.

$entry Value
The HTML field is a display only field so does not save a value in the entry.
Hooks
There are no hooks located in GF_Field_HTML.
Source Code
The source code is located in includes/fields/class-gf-field-html.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_List

GF_Field_List

IntroductionSettings and PropertiesSettingsPropertiesDynamic PopulationCalculations SupportConditional Logic Support$entry ValueMerge TagsUseful Methodsget_value_entry_detail()get_value_export()HooksSource Code

Introduction
The GF_Field_List class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the List field is rendered when the form is displayed and how its value is handled during and after submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
//get the field
$field = GFFormsModel::get_field( $form, 1 );

//get the admin label
$admin_label = $field->adminLabel;

Settings
The following settings are available for the field:

add_icon_url_setting
Determines whether the 「Add Icon URL」 section displays. This allows a URL to be entered to point to a different image to be used for the add row icon.

admin_label_setting
Controls whether the 「Admin Field Label」 setting appears.

columns_setting
Determines whether the 「Enable multiple columns」 section displays. This allows the List field to have more than the default one column, with each column having a distinct name.

conditional_logic_field_setting
Controls whether the 「Enable Conditional Logic」 setting appears.

css_class_setting
Controls whether the 「Custom CSS Class」 setting displays. This allows a custom css to be used for the field.

delete_icon_url_setting
Determines whether the 「Delete Icon URL」 section displays. This allows a URL to be entered to point to a different image to be used for the delete row icon.

description_setting
Controls whether the 「Description」 setting appears. This allows a description for the field to be displayed.

error_message_setting
Controls whether the 「Custom Validation Message」 setting which allows a custom message to be used appears.

label_setting
Controls whether the 「Field Label」 setting which allows the label to be changed appears.

maxrows_setting
Determines whether the 「Maximum Rows」 section displays. This allows a limit to be set for how many rows may be added as the form is filled out.

prepopulate_field_setting
Controls whether the 「Allow field to be populated dynamically」 setting appears.

rules_setting
Controls whether the 「Rules」 settings section displays. The 「Required」 option shows when this is active.

visibility_setting
Controls whether the 「Visibility」 setting displays. The controls whether the option of visibility being for 「Everyone」 or 「Admin Only」 can be set.

Properties
These are the properties used by the List field, which can be found in the Field Object, available to many of the hooks throughout Gravity Forms and some add-ons.

addIconUrl string
The URL of the image to be used for the add row button.

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

allowsPrepopulate boolean
Determines in the field value can be dynamically populated. Default is false.

choices array
An array containing the column labels. Only used when enableColumns is true.
$choices = array(
array(
'text' => 'Column 1',
'value' => 'Column 1',
),
array(
'text' => 'Column 2',
'value' => 'Column 2',
),
array(
'text' => 'Column 3',
'value' => 'Column 3',
),
);

Each column is an associative array containing the following properties:

text string
The text to be displayed in the column header. Required.

value string
The text to be displayed in the column header.

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

cssClass string
The custom CSS class or classes to be added to the li tag that contains the field.

deleteIconUrl string
The URL of the image to be used for the delete row button.

description string
The field description.

descriptionPlacement string
The field description position. Empty when using the form defaults, a value of 『below』 to position the description below the input container, or a value of 『above』 to position the description above the input container.

enableColumns boolean
Determines if the field should use multiple columns. Default is false.

errorMessage string
The custom error message to be displayed if the field fails validation.

formId integer
The ID of the form this field is located on.

id integer
The field ID.

inputName string
The parameter name used when dynamically populating the field. Only used when allowsPrepopulate is true.

isRequired boolean
Marking the field as required will prevent the form from being submitted if the user does not enter a value. Default is false.

label string
The field label that will be displayed on the form and on the admin pages.

labelPlacement string
The field label visibility. Empty when using the form defaults or a value of 『hidden_label』.

maxRows integer
The maximum number of rows the user can add to the field.

pageNumber integer
The form page this field is located on. Default is 1.

type string
The field type, which in this case is list.

Dynamic Population
When dynamically populating the List field via query string or the field_values parameter of the gravityform shortcode or the gravity_form function the required format is a string e.g. col1_row1|col2_row1,col1_row2|col2_row2
An array can be used to dynamically populate the field when using the gform_field_value_parameter_name filter.
If you are using the gravity_form function and have an array it would need to be converted to a string. You can do this by first serializing the array using the php serialize function and then passing that to get_value_entry_detail() which will return the dynamic population compatible string.
Calculations Support
Unfortunately the List field can』t currently be used with calculations; we do have this on the feature request list.
Conditional Logic Support
Unfortunately you can』t configure conditional logic rules on other fields based on the List field; we do have this on the feature request list.
$entry Value
The List field value is stored in the Entry Object as a serialized string. So if you submit this:

You will find the following in the entry:
a:3:{i:0;a:3:{s:8:"Column 1";s:3:"one";s:8:"Column 2";s:3:"two";s:8:"Column 3";s:5:"three";}i:1;a:3:{s:8:"Column 1";s:1:"i";s:8:"Column 2";s:2:"ii";s:8:"Column 3";s:3:"iii";}i:2;a:3:{s:8:"Column 1";s:1:"1";s:8:"Column 2";s:1:"2";s:8:"Column 3";s:1:"3";}}
When accessing the field value in the Entry Object you will want to unserialize it like so:
$list_values = unserialize( rgar( $entry, '3' ) );
You will then have an array which contains an associative array for each row. In each array the column label will be used as the key to the value.
$list_values = array(
array(
'Column 1' => 'one',
'Column 2' => 'two',
'Column 3' => 'three',
),
array(
'Column 1' => 'i',
'Column 2' => 'ii',
'Column 3' => 'iii',
),
array(
'Column 1' => '1',
'Column 2' => '2',
'Column 3' => '3',
),
);

Merge Tags
The field merge tag available via the merge tag drop down in notifications and confirmations will return the field entry value formatted as a table when the field has columns or as an unordered list.
{[Field Label]:[field_id]} e.g. {List:3}
You can use the :url modifier to return the field value as a string which could be used in a query string e.g. {List:3:url} would return one|1|i,two|2|ii,three|3|iii.
You can also use the gform_merge_tag_filter to implement your own custom modifiers to output an individual columns values.
The {all_fields} merge tag will return an unordered HTML list or a HTML table when multiple columns are enabled.
Useful Methods
GF_Field_List inherits it』s available methods from GF_Field and overrides a few of them where necessary to provide its required appearance and functionality. Here are a few methods which can be useful when writing custom code.
get_value_entry_detail()
The get_value_entry_detail() method formats the entry value before it is used in notifications, confirmations, and the entry detail page.
Usage Examples
// if you have access to the $field object
$value = $field->get_value_entry_detail( $value );

// if you don't have access to the $field object
$value = GF_Field_List::get_value_entry_detail( $value, '', false, 'url' );

$value string
The serialized string to be formatted.

$currency string
Not relevant to this field type. Default is an empty string.

$use_text boolean
Not relevant to this field type. Default is false.

$format string
How should the returned value be formatted. Default is html. Alternatives are text or url.

$media string
Where is the value being used. Default is screen. Alternative is email.

Returns string
An unordered HTML list or a HTML table when multiple columns are enabled and the $format is set to html. A comma and pipe separated string when the $format is url. A comma separated string when the $format is text.

get_value_export()
The get_value_export() method formats the entry value before it is used in entry exports and by framework add-ons that integrate with third-party services, however, you can use it in your custom code when interacting with the Form Object, Field Object and Entry Object.
Usage Examples
// if you have access to the $field object
$value = $field->get_value_export( $entry );

// if you don't have access to the $field object
$value = GF_Field_List::get_value_export( $entry, $input_id );

$entry Entry Object
The entry from which the field value should be retrieved. Required.

$input_id string
The ID of the field for which the value should be retrieved. Required when not using $field. Defaults to the $field->id property when not supplied. To access values for a specific column you can include the column number (zero based) with the field id e.g 3.1 would return the values from the second column.

Returns string
The values for a single column returned as comma separated string. When columns are enabled and a column number is not specified the entry value will be converted to a json string.

Hooks
The following hooks are located in GF_Field_List:

gform_column_input
gform_column_input_content

Source Code
The GF_Field_List class is located in includes/fields/class-gf-field-list.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_MultiSelect

GF_Field_MultiSelect

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_MultiSelect class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Multi Select field is rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
12345//get the field$field = GFFormsModel::get_field( $form, 1 ); //get the admin label$admin_label = $field->adminLabel;
Settings
The following settings are available for the field:

admin_label_setting
Controls whether the 「Admin Field Label」 setting appears.

choices_setting
Determines whether the 「Choices」 setting displays. This section allows you to create different selections for the multi select and set associated values to each one. It also allows you to choose from a pre-defined set of data that may be used to create the items in the list. Without this section, the drop down selections are limited to 「First Choice」, 「Second Choice」 and 「Third Choice」 and may not be changed in the editor.

conditional_logic_field_setting
Controls whether the 「Enable Conditional Logic」 setting appears.

css_class_setting
Controls whether the 「Custom CSS Class」 setting displays. This allows a custom css to be used for the field.

description_setting
Controls whether the 「Description」 setting appears. This allows a description for the field to be displayed.

enable_enhanced_ui_setting
Determines whether the 「Enable enhanced user interface」 setting displays. This setting allows the Chosen jquery script to be used to add search capability to the multi select.

error_message_setting
Controls whether the 「Custom Validation Message」 setting which allows a custom message to be used appears.

label_setting
Controls whether the 「Field Label」 setting which allows the label to be changed appears.

prepopulate_field_setting
Controls whether the 「Allow field to be populated dynamically」 setting appears.

rules_setting
Controls whether the 「Rules」 settings section displays. The 「Required」 option shows when this is active.

size_setting
Controls whether the 「Field Size」 setting displays. This controls the size of the input field for fields to which it applies. The sizes are 「small」, 「medium」, and 「large」.

visibility_setting
Controls whether the 「Visibility」 setting displays. The controls whether the option of visibility being for 「Everyone」 or 「Admin Only」 can be set.

Properties
Below is a listing of the properties inherited from the parent class and ones specific to the field:

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

adminOnly boolean
Determines whether the field is visible to the user submitting the form, or only visible in the admin.

allowsPrepopulate boolean
Determines if the field values can be dynamically populated. Default is false.

choices array
An array containing the the individual properties for each item in the multi select.

text string
The text that is displayed

value string
The value that is used for the multi select when the form is submitted.

isSelected boolean
Indicates whether the item is selected
1234567891011121314151617$choices = array(           array(             'text'       => 'First Choice',             'value'      => 'one',             'isSelected' => false           ),           array(             'text'       => 'Second Choice',             'value'      => 'two',             'isSelected' => true           ),           array(             'text'       => 'Third Choice',             'value'      => 'three',             'isSelected' => false           ),         );

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

cssClass string
The custom CSS class or classes to be added to the input tag for the field.

description string
The field description.

descriptionPlacement string
The placement of the field description. The description may be placed 「above」 or 「below」 the field inputs. If the placement is not specified, then the description placement setting for the Form Layout is used.

enableChoiceValue boolean
Indicates whether the 「show values」 option within the 「Choices」 section of the editor is checked.

enableEnhancedUI boolean
Indicates whether the option to use the Chosen jquery script to add search capability to the drop down is checked.

errorMessage string
The custom error message to be displayed if the field fails validation.

formId integer
The form ID.

id integer
The field ID.

inputName string
The parameter name used when dynamically populating the field. The value must match the value of an item in the multi select.

isRequired boolean
Marking the field as required will prevent the form from being submitted if the user does not enter a value. Default is false.

label string
The field label that will be displayed on the form and on the admin pages.

size string
Controls the width of the input field. The choices are 「small」, 「medium」, and 「large」.

type string
The field type. It is set to 「multiselect」.

Source Code
The source code is located in includes/fields/class-gf-field-multiselect.php in the Gravity Forms folder of your sites plugins directory.

GF_Field_Name

GF_Field_Name

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Name class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Name field is rendered when the form is displayed and how its value is handled during and after form submission.
Settings and Properties
Settings control what options are available to the admin user when configuring the field in the form editor. Gravity Forms includes many built-in settings such as Field Label, Field Description, Choices, Conditional Logic, etc. In addition to built-in settings, custom settings can also be developed. For more information on how to develop custom settings and how to associate settings to a field, visit the GF_Field page.
Properties contain the values specified by the settings and generally are part of the Field Object.
The properties may be retrieved by accessing the Field Object as follows:
//get the field
$field = GFFormsModel::get_field( $form, 1 );

//get the admin label
$admin_label = $field->adminLabel;

Settings
The following settings are available for the field:

admin_label_setting
Controls whether the 「Admin Field Label」 setting appears.

conditional_logic_field_setting
Controls whether the 「Enable Conditional Logic」 setting appears.

css_class_setting
Controls whether the 「Custom CSS Class」 setting displays. This allows a custom css to be used for the field.

default_input_values_setting
For complex fields like the name, time, address fields, this controls whether the 「Default Values」 section will appear which lets you set values for the individual components of the field. When it is not a complex field, the 「default_value_setting」 controls the display of this section.

description_setting
Controls whether the 「Description」 setting appears. This allows a description for the field to be displayed.

error_message_setting
Controls whether the 「Custom Validation Message」 setting which allows a custom message to be used appears.

input_placeholders_setting
For complex fields like the name, time, and address fields, this controls whether the 「Placeholders」 section will appear which lets you set placeholder text for the individual components of the field. When it is not a complex field, the 「placeholder_setting」 controls the display of this section.

label_setting
Controls whether the 「Field Label」 setting which allows the label to be changed appears.

name_setting
This setting has been deprecated and is currently in the code for backwards-compatibility only.

prepopulate_field_setting
Controls whether the 「Allow field to be populated dynamically」 setting appears.

rules_setting
Controls whether the 「Rules」 settings section displays. The 「Required」 option shows when this is active.

sub_label_placement_setting
If a field has sub-labels, controls whether the 「Sub-Label Placement」 setting appears.

visibility_setting
Controls whether the 「Visibility」 setting displays. The controls whether the option of visibility being for 「Everyone」 or 「Admin Only」 can be set.

Properties
Below is a listing of the properties inherited from the parent class, and the properties unique to the Name field.

adminLabel string
The label to be used on admin pages instead of the label, useful for fields with long labels.

adminOnly boolean
Determines whether the field is visible to the user submitting the form, or only visible in the admin.

allowsPrepopulate boolean
Determines if the field values can be dynamically populated. Default is false.

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

cssClass string
The custom CSS class or classes to be added to the input tag for the field.

description string
The field description.

descriptionPlacement string
The placement of the field description. The description may be placed 「above」 or 「below」 the field inputs. If the placement is not specified, then the description placement setting for the Form Layout is used.

errorMessage string
The custom error message to be displayed if the field fails validation.

formId integer
The form ID.

id integer
The field ID.

inputs array
An array containing the the individual properties for each element of the name field.

id integer
The id of the input field.

label string
The label for the input.

name string
The name of the parameter used for the input when dynamically populating the field.

customLabel string
The custom label for the input. When set, this is used in place of the label.

placeholder string
Placeholder text to give the user a hint on how to fill out the field. This is not submitted with the form.

defaultValue string
The default value to be displayed/chosen in the input field.

isHidden boolean
Controls whether the input is visible.

enableChoiceValue boolean
Indicates whether the choice has a value, not just the text. This is only available for the Prefix field.

inputType string
This is only available when it is the Prefix field and is set to 「radio」.

choices array
This array only exists when the Prefix field is used. It holds the prefix options that display in the drop down. These have been chosen in the admin.

text string
The text that is displayed in the Prefix drop down

value string
The value that is submitted with the form

isSelected boolean
Indicates which item in the drop down is selected
$inputs = array(
array(
'id' => '1.2',
'label' => 'Prefix',
'name' => 'param_prefix',
'customLabel' => '',
'placeholder' => 'Select a Prefix',
'defaultValue' => '',
'isHidden' => false,
'inputType' => 'radio',
'enableChoiceValue' => false,
'choices' => array(
array(
'text' => 'Mr.',
'value' => 'Mr.',
'isSelected' => false
),
array(
'text' => 'Ms.',
'value' => 'Ms.',
'isSelected' => true
)
)
),
array(
'id' => '1.3',
'label' => 'First',
'name' => 'param_first',
'customLabel' => 'First Name',
'placeholder' => '',
'defaultValue' => '',
'isHidden' => false
),
array(
'id' => '1.4',
'label' => 'Middle',
'name' => '',
'customLabel' => 'Middle Initial',
'placeholder' => 'Enter your middle initial',
'defaultValue' => '',
'isHidden' => false
),
array(
'id' => '1.6',
'label' => 'Last',
'name' => 'param_last',
'customLabel' => 'Last Name',
'placeholder' => '',
'defaultValue' => '',
'isHidden' => false
),
array(
'id' => '1.8',
'label' => 'Suffix',
'name' => '',
'customLabel' => '',
'placeholder' => '',
'defaultValue' => '',
'isHidden' => true
),
);

isRequired boolean
Marking the field as required will prevent the form from being submitted if the user does not enter a value. Default is false.

label string
The field label that will be displayed on the form and on the admin pages.

nameFormat string
The format of the name field. Originally, the name field could be a 「normal」 format with just First and Last being the fields displayed or an 「extended」 format which included prefix and suffix fields, or a 「simple」 format which just had one input field. These are legacy formats which are no longer used when adding a Name field to a form. The Name field was modified in a way which allows each of the components of the normal and extended formats to be able to be turned on or off. The nameFormat is now only 「advanced」. Name fields in the previous formats are automatically upgraded to the new type if the form field is modified in the admin. The code is backwards-compatible and will continue to handle the 「normal」, 「extended」, 「simple」 formats for fields which have not yet been upgraded.

size string
Controls the width of the input field. The choices are 「small」, 「medium」, and 「large」.

subLabelPlacement string
The placement of the labels for the fields (prefix, first, last, suffix, etc.) within the name group. This setting controls all of the name pieces, they cannot be set individually. They may be aligned above or below the inputs. If this property is not set, the 「Sub-Label Placement」 setting on the Form Settings->Form Layout page is used. If no setting is specified, the default is above inputs.

type string
The field type, which in this case is name.

Source Code
The source code is located in includes/fields/class-gf-field-name.php in the Gravity Forms folder of your sites plugins directory.