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_Password

GF_Field_Password

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Password class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Password field is rendered when the form is displayed and how its value is handled during and after form submission. The Password field is not available in Gravity Forms by default. The Gravity Forms User Registration Add-on is one of the plugins which will add this field to the list of available fields.
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 password strength$password_strength_enabled = $field->passwordStrengthEnabled;
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.

input_placeholders_setting
For complex fields like the password, 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.

password_strength_setting
Controls whether the 「Enable Password Strength」 section displays. This allows the minimum password strength to be set to Short, Bad, Good, or Strong.

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

sub_labels_setting
If a field has sub-labels, controls whether the setting to set them appears.

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

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.

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 password field.

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.

An example of the array output is as follows:
1234567891011121314$inputs = array(            array(              'id'          => '1',              'label'       => 'Enter Password',              'customLabel' => 'Password',              'placeholder' => 'Please enter your password'            ),            array(              'id'          => '1.2',              'label'       => 'Confirm Password',              'customLabel' => 'Confirmation',              'placeholder' => 'Please confirm your password'            ),          )

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 placement of the main field label 「Address」. 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 address group, use the 「subLabelPlacement」 property.

minPasswordStrength string
Indicates how strong the password should be. The possible values are short, bad, good, strong.

passwordStrengthEnabled boolean
Indicates whether the field displays the password strength indicator.

subLabelPlacement string
The placement of the labels for the fields (street, city, zip/postal code, etc.) within the address group. This setting controls all of the address 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 password.

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

GF_Field_Address

GF_Field_Address

IntroductionSettings and PropertiesSettingsProperties$entry ValueUseful Methodsget_address_types()get_countries()get_country_code()get_country_codes()get_us_states()get_us_state_code()get_canadian_provinces()get_value_export()HooksSource Code

Introduction
The GF_Field_Address class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Address 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 address type$address_type = $field->addressType;
Settings
The following settings are available for the field:

address_setting
Controls whether the group of Address field settings display. This group includes the 「Address Type」, custom sub-labels, ability to show/hide the individual field parts, 「Default Country」 (if International type is chosen), 「Default State」 (if United States is chosen), 「Default Province」 (if Canadian is chosen).

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

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

copy_values_option
Controls whether the 「Display option to use the values submitted in different field」 setting displays. The option is used to determine whether the values from another address field on the form may be used for the current field. Example: Copying Billing Address to the Mailing Address field.

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.

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 field:

addressType string
The address type. This indicates the information/layout of the address. The available choices are 「international」, 「canadian」, and 「us」.

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.

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

copyValuesOptionDefault boolean
Determines whether the option to copy values is turned on or off by default.

copyValuesOptionField integer
The field id of the field being used as the copy source.

copyValuesOptionLabel string
The label that appears next to the copy values option when the form is displayed. The default value is 「Same as previous」.

defaultCountry string
The default country to be chosen in the Country drop down, if displayed. If the 「defaultValue」 property is set in the 「inputs」 array for the country input, the defaultValue will be used instead of this property. This is a legacy property that should no longer be used. Instead, use the 「defaultValue」 property of the 「inputs」 array.

defaultProvince string
The default province to be chosen in the Province drop down, if displayed. If the 「defaultValue」 property is set in the 「inputs」 array for the province input, the defaultValue will be used instead of this property. This is a legacy property that should no longer be used. Instead, use the 「defaultValue」 property of the 「inputs」 array.

defaultState string
The default state to be chosen in the State drop down, if displayed. If the 「defaultValue」 property is set in the 「inputs」 array for the state input, the defaultValue will be used instead of this property. This is a legacy property that should no longer be used. Instead, use the 「defaultValue」 property of the 「inputs」 array.

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.

enableCopyValuesOption boolean
Indicates whether the copy values option can be used. This option allows users to skip filling out the field and use the same values as another. For example, if the mailing and billing address are the same.

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

formId integer
The form ID.

hideAddress2 boolean
Legacy property used to control whether the address2 input is visible. To hide the state, use the 「isHidden」 property of the 「inputs」 array instead.

hideCountry boolean
Legacy property used to control whether the country input is visible. To hide the state, use the 「isHidden」 property of the 「inputs」 array instead.

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

id integer
The id of the input field.

name string
The name of the parameter used for the input when dynamically populating the 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/chosen in the input field.

isHidden boolean
Controls whether the input is visible.

123456789101112131415161718192021222324252627282930313233343536373839404142434445$inputs = array(            array(              'id'           => '1.1',              'label'        => 'Street Address',              'customLabel'  => 'Custom Street',              'placeholder'  => 'Enter your street address',              'defaultValue' => '100 Main Street',              'isHidden'     => false            ),            array(              'id'          => '1.2',              'label'       => 'Address Line 2',              'customLabel' => 'Custom Street 2',              'placeholder' => 'Enter street 2',              'isHidden'    => true             ),            array(              'id'           => '1.3',              'label'        => 'City',              'customLabel'  => 'Custom City',              'placeholder'  => 'Enter your city',              'defaultValue' => 'Anywhere'            ),            array(              'id'           => '1.4',              'label'        => 'State / Province',              'customLabel'  => 'Custom State',              'placeholder'  => 'Enter your state',              'defaultValue' => 'Virginia'            ),            array(              'id'          => '1.5',              'label'       => 'ZIP / Postal Code',              'customLabel' => 'Custom Zip',              'placeholder' => 'Enter your zip'            ),            array(              'id'           => '1.6',              'label'        => 'Country',              'customLabel'  => 'Custom Country',              'placeholder'  => 'Select your country',              'defaultValue' => 'United States'            ),          )

hideState boolean
Legacy property used to control whether the state input is visible. To hide the state, use the 「isHidden」 property of the 「inputs」 array instead.

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.

labelPlacement string
The placement of the main field label 「Address」. 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 address group, use the 「subLabelPlacement」 property.

subLabelPlacement string
The placement of the labels for the fields (street, city, zip/postal code, etc.) within the address group. This setting controls all of the address 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 address.

$entry Value
The Address field is a multi-input field type with each input being saved separately in the Entry Object.
The key to each input value in the entry is the input id which is in the format {field_id}.{input_number}, so if the field ID is 5 here』s how you can access each input value:
1234567$field_id      = 5;$street_value  = rgar( $entry, $field_id . '.1' );$street2_value = rgar( $entry, $field_id . '.2' );$city_value    = rgar( $entry, $field_id . '.3' );$state_value   = rgar( $entry, $field_id . '.4' );$zip_value     = rgar( $entry, $field_id . '.5' );$country_value = rgar( $entry, $field_id . '.6' );
The get_value_export method can also be used to retrieve the entry values.
Useful Methods
GF_Field_Address 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_address_types()
The get_address_types() method returns an array of address types for the current form.
Usage Example
1$address_types = $field->get_address_types( $form_id );

$form_id integer
The form ID.

Returns array
An array of the supported address types in the following format:

123456789101112131415161718192021$address_types = array(                   'international' => array(                                        'label'      => 'International',                                        'zip_label'  => 'ZIP / Postal Code',                                        'state_label => 'State / Province / Region'                                      ),                   'us'            => array(                                        'label'       => 'United States',                                        'zip_label'   => 'ZIP Code',                                        'state_label' => 'State',                                        'country'     => 'United States',                                        'states'      => array( '', 'Alabama', 'Alaska', 'Arizona' )                                      ),                   'canadian'      => array(                                        'label'       => 'Canadian',                                        'zip_label'   => 'Postal Code',                                        'state_label' => 'Province',                                        'country'     => 'Canada',                                        'states'      => array( '', 'Alberta', 'British Colombia', 'Manitoba' )                                      )                 );

get_countries()
The get_countries() method returns an array of countries.
Usage Example
1$countries = $field->get_countries();

Returns array
An array of country names in the following format:

1234567$countries = array(               'Afghanistan',               'Albania',               'Algeria',               'American Samoa',               'Zimbabwe'             );

get_country_code()
The get_country_code() method return the two character code for the specified country.
Usage Example
1$country_code = $field->get_country_code( $country_name );

$country_name string
The country name.

Returns string
The country code for the provided country name.

get_country_codes()
The get_country_codes() method returns an array of two character country codes.
Usage Example
1$country_codes = $field->get_country_codes();

Returns array
An array of the country name and its country code in the following format:

1234567$country_codes = array(                   'AFGHANISTAN'    => 'AF',                   'ALBANIA'        => 'AL',                   'ALGERIA'        => 'DZ',                   'AMERICAN SAMOA' => 'AS',                   'ZIMBABWE'       => 'ZW'                 );

get_us_states()
The get_us_states() method returns an array of US state names.
Usage Example
1$states = $field->get_us_states();

Returns array
An array of the US state names in the following format:

1234567$states = array(            'Alabama',            'Alaska',            'Arizona',            'Arkansas',            'Wyoming'          );

get_us_state_code()
The get_us_state_code() method returns the two character code for the specified state name.
Usage Example
1$state = $field->get_us_state_code( $state_name );

$state_name string
The state name.

Returns string
The two character code for the provided state name.

get_canadian_provinces()
The get_canadian_provinces() method returns an array of Canadian provinces.
Usage Example
1$provinces = $field->get_canadian_provinces();

Returns array
An array of the Canadian provinces in the following format:

1234567$provinces = array(               'Alberta',               'British Columbia',               'Manitoba',               'New Brunswick',               'Yukon'             );

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
123456// if you have access to the $field object$value = $field->get_value_export( $entry ); // if you don't have access to the $field object you can get that first like so$field = GFFormsModel::get_field( $form, $field_id );$value = $field->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 the value of a specific input you can include the input number with the field id e.g *5.1** would return the value from the Street Address input for field 5.

Returns string
The values for the full field as a comma separated string or the value for a specific input.

Hooks
The following hooks are located in GF_Field_Address:

gform_address_display_format
gform_address_street
gform_address_street2
gform_address_zip
gform_address_city
gform_address_state
gform_address_country
gform_default_address_type
gform_address_types
gform_countries
gform_us_states
gform_disable_address_map_link

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

GF_Field_Time

GF_Field_Time

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Time class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Time 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.

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.

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.

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_labels_setting
If a field has sub-labels, controls whether the setting to set them appears.

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

time_format_setting
Controls whether the 「Time Format」 setting displays.

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.

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.

inputName string
The parameter name used when dynamically populating the field. The parameter will be formatted as HH:MM AM/PM, ex: 12:30 PM.

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

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. For the website field, the text 「http://」 is displayed.

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

$inputs = array(
array(
'id' => '1.1',
'label' => 'HH',
'name' => '',
'customLabel' => 'Hours (HH)',
'placeholder' => 'Enter the hours',
'defaultValue' => '10',
),
array(
'id' => '1.2',
'label' => 'MM',
'name' => '',
'customLabel' => 'Minutes (MM)',
'placeholder' => 'Enter the minutes',
'defaultValue' => '30',

),
array(
'id' => '1.3',
'label' => 'AM/PM',
'name' => '',
'customLabel' => 'am/pm',
'defaultValue' => 'PM'
),
);

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 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 boolean
Determines if the value entered by the user may already exist in the database.

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 (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.

timeFormat string
Determines whether the time is displayed in 12 hour or 24 hour format. The value is 「12」 or 「24」.

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

Source Code
The source code is located in includes/fields/class-gf-field-time.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.

Getting the Form Field Filters with REST API v2

Getting the Form Field Filters with REST API v2

IntroductionMethodPathRequired PropertiesOptional PropertiesResponse [json]Usage ExamplesExample 1Example 2

Introduction
The field-filters endpoint was added in Gravity Forms 2.4.21.8, it returns the field filters for the specified form. Internally Gravity Forms uses the field filters to populate the search drop down on the entries list page and the filter condition settings on the sales/results pages. You can use the response from this endpoint to create similar features on remote sites or simply use it to help determine which keys and operators to use with the field_filters array of the GET entries search property.
Method
This endpoint only accepts GET requests.
Path
/gf/v2/forms/[FORM_ID]/field-filters
Required Properties
There are no required properties.
Optional Properties

_admin_labels – Use the value 「1」 to include the field admin labels in the response, if configured.

Response [json]
The response will contain a JSON object which contains the field filters for the specified form. Examples can be found below.
Usage Examples
Example 1
This example shows how to get the field filters for form id 577.

Example 2
This example shows how to get the field filters for form id 577 using the field admin labels, if configured.

GF_Field_Select

GF_Field_Select

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Select class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Drop Down field is rendered when the form is displayed and how its value is handled during and after form submission. This class also handles the rendering of the Product, Product Option, Quantity, Shipping fields when they are a drop down.
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 drop down selections 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 drop down. 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.

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.

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 drop down.

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 ones 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.

choices array
An array containing the the individual properties for each item in the drop down.

text string
The text that is displayed for the drop down.

value string
The value that is used for the drop down when the form is submitted.

isSelected boolean
Indicates whether the drop down item is selected

price string
Used when the drop down is a Product, Product Option or Shiping field and contains the item price.

Below is an example of the output:
1234567891011121314151617181920$choices = array(             array(               'text'       => 'First Choice',               'value'      => 'one',               'isSelected' => false,               'price'      => '$5.00' //only populated if a product, product option, shipping field             ),             array(               'text'       => 'Second Choice',               'value'      => 'two',               'isSelected' => true,               'price'      => ''             ),             array(               'text'       => 'Third Choice',               'value'      => 'three',               'isSelected' => false,               'price'      => ''             ),           )

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 to be chosen in the drop down field. This must match to a value for one of the items.

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.

enablePrice boolean
This property is used when the drop down is a Product, Product Option, or Shipping field and will be set to true. If not associated with one of those fields, it is false.

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.

inputType string
Used when the field has a sub-type. For instance, when the drop down is a Product, Product Option, Quantity, or Shipping field, then the 「type」 is set to product when a Product field, option when a Product Option field, quantity when a Quantity field, shipping when a Shipping field. The 「inputType」 is set to select. 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.

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. This will be displayed as the first item in the drop down.

productField integer
The id of the product field to which the drop down is associated. This is used when the drop down is an Option or Quantity field associated with a product.

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

type string
The field type. It is normally select, unless the drop down is a Product, Product Option, Quantity or Shipping field. The type is set to product when a Product Field, option when a Product Option field, quantity when a Quantity, shipping when a Shipping field. The 「inputType」 is set to select.

Source Code
The source code is located in includes/fields/class-gf-field-select.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_Phone

GF_Field_Phone

IntroductionSettings and PropertiesSettingsPropertiesSource Code

Introduction
The GF_Field_Phone class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Phone 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.

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.

phone_format_setting
Controls whether the 「Phone Format」 section displays. The section allows the phone format to be set to domestic US/Canada style or international.

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.

description string
The field description.

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.

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.

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

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.

phoneFormat string
The format for the phone number. The possible values are 「standard」 or 「international」.

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

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

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

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

GF_Field_Calculation

GF_Field_Calculation

IntroductionSettings and PropertiesSettingsPropertiesHooksSource Code

Introduction
The GF_Field_Calculation class extends the GF_Field class, also known as the Field Object. This class is responsible for determining how the Calculation type Product 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 formula$formula = $field->calculationFormula;
Settings
The following settings are available for the field:

calculation_setting
Determines whether the 「Formula」 section displays. This section allows a formula to be entered, merge tags to be used, and the formula entered to be validated.

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

disable_quantity_setting
Determines whether the 「Disable quantity field」 checkbox appears. This allows the quantity to be removed from the field. A default value of 1 will be used, unless a separate Quantity field is added.

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.

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

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.

calculationFormula string
The formula to be used to calculate the price.

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.

enableCalculation boolean
Indicates whether the calculation use is active.

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.

disableQuantity boolean
Indicates whether the Quantity field is active.

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
Specifies the sub-type of Product field being used. For instance, when the field is for a product, the 「type」 is set to product and the 「inputType」 is set to calculation. 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.

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.

type string
The field type, which in this case is product. The specific type of product field is in the 「inputType」 property.

Hooks
The following hooks are located in GF_Field_Calculation:

gform_product_quantity
gform_product_price

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