Time Field CSS Selectors

Time Field CSS Selectors

HoursContainerInput FieldSub-LabelMinutesContainerInput FieldSub-LabelAM/PMContainerSelector

Hours
Container
Contains the hours input field and sub-label

example: time – hours container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_hour {border: 1px solid red}

example: time – hours container (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_hour {border: 1px solid red}

example: time – hours container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_hour {border: 1px solid red}

Input Field

example: time – hours input field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_hour input {border: 1px solid red}

example: time – hours input field (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_hour input {border: 1px solid red}

example: time – hours input field (input) – applies just to specific form field (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_hour input {border: 1px solid red}

Sub-Label

example: time – hours sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_hour label {color: red}

example: time – hours sub-label (label) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_hour label {color: red}

example: time – hours sub-label (label) – applies just to specific sub-label (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_hour label {color: red}

Minutes
Container
Contains the minutes input field and sub-label

example: time – minutes container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_minute {border: 1px solid red}

example: time – minutes container (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_minute {border: 1px solid red}

example: time – minutes container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_minute {border: 1px solid red}

Input Field

example: time – minutes input field (input) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_minute input {border: 1px solid red}

example: time – minutes input field (input) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_minute input {border: 1px solid red}

example: tim – minutes input field (input) – applies just to specific form field (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_minute input {border: 1px solid red}

Sub-Label

example: time – minutes sub-label (label) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_minute label {color: red}

example: time – minutes sub-label (label) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_minute label {color: red}

example: time – minutes sub-label (label) – applies just to specific sub-label (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_minute label {color: red}

AM/PM
Container
Contains the minutes input field and sub-label

example: time – AM/PM container (div) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_ampm {border: 1px solid red}

example: time – AM/PM container (div) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_ampm {border: 1px solid red}

example: time – AM/PM container (div) – applies just to specific container (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_ampm {border: 1px solid red}

Selector

example: time – AM/PM selector (select) – applies to all forms
body .gform_wrapper .gform_body .gform_fields .gfield .gfield_time_ampm select {border: 1px solid red}

example: time – AM/PM selector (select) – applies just to form ID #1
body #gform_wrapper_1 .gform_body .gform_fields .gfield .gfield_time_ampm select {border: 1px solid red}

example: time – AM/PM selector (select) – applies just to specific drop-down field (based on the unique parent element ID – replace 「XX_X」 with your actual element ID)
body .gform_wrapper .gform_body .gform_fields #field_XX_X.gfield .gfield_time_ampm select {border: 1px solid red}

Third Party Resources

Third Party Resources

Community Provided Add-OnsGravity Wiz (website)Gravity Perks (plugin)Gravity Flow (plugin)

Community Provided Add-Ons
We have created a library of third party add-ons that various developers have provided to work with Gravity Forms. Gravity Forms cannot guarantee or endorse these this party solutions, but we can certainly point you in their direction as the perfect solution to your problem may only be a search away!
Gravity Forms third party add-ons library.
A few of our community add-ons are actually offered by our very own team members (though these are not provided, guaranteed or supported by Gravity Forms in any way, but are listed here as a helpful sign post for our users)…
Gravity Wiz (website)
Created by one of the rocketgenius staff, Dave Smith, Gravity Wiz has tips, tricks and code snippets that will help add new features to Gravity Forms.
Check out GravityWiz.com for more information.
Gravity Perks (plugin)
Gravity Wiz also provides a paid service called Gravity Perks, a plugin and support package that gives you some useful features including:

Conditional Pricing (for dynamic product pricing)
Unique ID (for generating unique IDs)
Submission Preview (for providing a confirmation before submission)
Multi-page Form Navigation (for navigating more quickly between form pages)
Limit Choices (for providing the concept of inventory for your choices)
Copy Cat (for copying from one field to another)
And many more!

Check out Gravity Perks for more information.
Gravity Flow (plugin)
Another plugin by one of rocketgenius』 staff, Steve Henty. Gravity Flow allows you to automate your business processes. You can monitor, optimize & secure your workflow management with zero custom code.
Check out GravityFlow.io for more information.

The simple_condition Helper

The simple_condition Helper

IntroductionInclude the custom settingDefine custom_logic_type field markupPopulate the fields drop downEvaluate the rules

Introduction
When using the Settings API there may be times when you need a field type which allows the user to define a simple conditional logic rule, that』s where the simple_condition() function helps.

Include the custom setting
Because there isn』t an actual simple_condition field type you would need to create your own Custom Field Type. In this example our custom field type will be named custom_logic_type, it is defined in the settings fields array like so:
12345array(    'label' => esc_html__( 'Simple condition', 'simpleaddon' ),    'type'  => 'custom_logic_type',    'name'  => 'custom_logic',),
Define custom_logic_type field markup
Now the setting has been included we need to define the markup for the custom_logic_type field type so it can be displayed on the settings page.
Because we don』t want the simple condition settings to be used all the time we will add a checkbox which can be used to enable/disable them. An onlclick event will be added to the checkbox to show/hide the div containing the simple condition settings.
1234567891011121314151617181920212223242526272829303132public function settings_custom_logic_type( $field, $echo = true ) {     // Get the setting name.    $name = $field['name'];     // Define the properties for the checkbox to be used to enable/disable access to the simple condition settings.    $checkbox_field = array(        'name'    => $name,        'type'    => 'checkbox',        'choices' => array(            array(                'label' => esc_html__( 'Enabled', 'simpleaddon' ),                'name'  => $name . '_enabled',            ),        ),        'onclick' => "if(this.checked){jQuery('#{$name}_condition_container').show();} else{jQuery('#{$name}_condition_container').hide();}",    );     // Determine if the checkbox is checked, if not the simple condition settings should be hidden.    $is_enabled      = $this->get_setting( $name . '_enabled' ) == '1';    $container_style = ! $is_enabled ? "style='display:none;'" : '';     // Put together the field markup.    $str = sprintf( "%s

%s

",        $this->settings_checkbox( $checkbox_field, false ),        $name,        $container_style,        $this->simple_condition( $name )    );     echo $str;}
Populate the fields drop down
We need to define which fields are to be available for selection in the simple condition settings fields drop down.
123456789101112131415161718192021222324252627282930313233public function get_conditional_logic_fields() {    $form   = $this->get_current_form();    $fields = array();    foreach ( $form['fields'] as $field ) {        if ( $field->is_conditional_logic_supported() ) {            $inputs = $field->get_entry_inputs();             if ( $inputs ) {                $choices = array();                 foreach ( $inputs as $input ) {                    if ( rgar( $input, 'isHidden' ) ) {                        continue;                    }                    $choices[] = array(                        'value' => $input['id'],                        'label' => GFCommon::get_label( $field, $input['id'], true )                    );                }                 if ( ! empty( $choices ) ) {                    $fields[] = array( 'choices' => $choices, 'label' => GFCommon::get_label( $field ) );                }             } else {                $fields[] = array( 'value' => $field->id, 'label' => GFCommon::get_label( $field ) );            }         }    }     return $fields;}
Evaluate the rules
To evaluate the rules the user configured for the custom_logic setting we will need to create a custom helper function. In this example the setting is being used on a form settings page so we need to retrieve them from the form settings. If the settings are being used on a feed settings page you would need to retrieve them from the $feed[『meta』].
1234567891011121314151617181920212223242526public function is_custom_logic_met( $form, $entry ) {    $settings = $this->get_form_settings( $form );     $name       = 'custom_logic';    $is_enabled = rgar( $settings, $name . '_enabled' );     if ( ! $is_enabled ) {        // The setting is not enabled so we handle it as if the rules are met.         return true;    }     // Build the logic array to be used by Gravity Forms when evaluating the rules.    $logic = array(        'logicType' => 'all',        'rules'     => array(            array(                'fieldId'  => rgar( $settings, $name . '_field_id' ),                'operator' => rgar( $settings, $name . '_operator' ),                'value'    => rgar( $settings, $name . '_value' ),            ),        )    );     return GFCommon::evaluate_conditional_logic( $logic, $form, $entry );}
This helper can then be used wherever you need to evaluate the rules, in the sample add-on available on GitHub the helper is used to determine if a custom action should be performed at the end of the form submission process.
123456789public function after_submission( $entry, $form ) {     // Evaluate the rules configured for the custom_logic setting.    $result = $this->is_custom_logic_met( $form, $entry );     if ( $result ) {        // Do something awesome because the rules were met.    }}

The Importance of Updates

The Importance of Updates

Risks of neglecting updatesKeeping everything up to date

Often times when running a website, individuals will only make the changes they need and neglect the general maintenance of the site, including things such as updates. As described in our article on security practices, keeping WordPress as well as any plugins of themes is critical to your site』s health.
Risks of neglecting updates

The biggest risk you face by not keeping everything up to date is security issues. Many times, updates are pushed out to solidify the security of the code. By neglecting updates, critical security flaws can be introduced and cause issues such as a fully compromised website or allow execution of unwanted code. Simply keeping everything up to date at all times will largely prevent issues.
Lack of compatibility is also a concern if one thing is updated, but not others. For example, if you updated WordPress to the next major version, but not Gravity Forms, you can sometimes run into bugs as something Gravity Forms may have been using in the older version, may not be present or changed in the newer version.
A large majority of the code placed in minor updates, is simply to correct a bug that may exist. Failing to update your plugins can expose you to those bugs and sometimes lead to an overall poor experience.

Keeping everything up to date

Check for updates often. Simply logging into your WordPress admin dashboard and checking to see if updates are available will greatly assist you with keeping everything up to date.
Add license keys for Gravity Forms and other premium plugins. Without a valid license keys saved in the plugin settings, WordPress is unable to check for updates on your behalf.
Use a management tool. If you have multiple sites that you need to maintain, logging into each of them daily to check for updates can be a bit of a pain. Tools such as WP Remote can allow you to check multiple sites for available updates with a single click of a button.
Enable automatic updates. What』s better than logging into sites daily to check for updates? Automatic updates! The WordPress codex has an excellent article on enabling automatic updates both within WordPress core, as well as for plugins. You can find it at the Enabling Automatic Background Updates article.

Maintaining updated software by far one of the most important aspects of running a successful website. With the knowledge you have gained in this article, you should be able to easily maintain current copies of all software running on your site.

Textarea Field

Textarea Field

IntroductionExampleUses

Introduction
The textarea type field, part of the Settings API, renders a textarea element.
Example
The following example shows a section with a textarea type field. The text specified in the default_value property for the textarea will display until the user enters new text and saves/submits.
array(
'title' => esc_html__( 'This is the title for Section 4', 'sometextdomain' ),
'fields' => array(
array(
'type' => 'textarea',
'name' => 'mytextarea',
'label' => esc_html__( 'This is my textarea', 'sometextdomain' ),
'default_value' => 'This is some default text that will show in the textarea',
'tooltip' => esc_html__( 'This is the tooltip for the textarea', 'sometextdomain' ),
'class' => 'large',
),
),
),

The code above will render the textarea field similar to the following:

Uses

settings_textarea()

Text Field

Text Field

IntroductionExampleUses

Introduction
The text type field, part of the Settings API, renders a text input.
Example
The following example shows a section with two text boxes.
The first text box is required and upon submission, the function validate_mytextfield specified in the feedback_callback property will be called to check additional conditions.
The second text box only displays based on the result of the dependency property. If the field mytextfield_name (the first text box) has a value of showtestfield2 or test, the second text box will display.
array(
'title' => esc_html__( 'This is the title for Section 1', 'sometextdomain' ),
'description' => esc_html__( 'This is a description of the purpose of Section 1', 'sometextdomain' ),
'fields' => array(
array(
'type' => 'text',
'id' => 'mytextfield_id',
'name' => 'mytextfield_name',
'label' => esc_html__( 'This is my text field', 'sometextdomain' ),
'required' => true,
'value' => 'This is the data specified for the value property',
'default_value' => 'This is the data specified for the default value property',
'class' => 'medium',
'tooltip' => esc_html__( 'This is my tooltip', 'sometextdomain' ),
'tooltip_class' => 'tooltipclass',
'feedback_callback' => array( $this, 'validate_mytextfield' ),
),
array(
'type' => 'text',
'name' => 'mytextfield2_name',
'label' => esc_html__( 'This is my second text field', 'sometextdomain' ),
'dependency' => array( 'field' => 'mytextfield_name', 'values' => array( 'showtextfield2', 'test' ) ),
),
)
),

The code above will render the text boxes similar to the following:

Uses

settings_text()

Testing for a Theme/Plugin Conflict

Testing for a Theme/Plugin Conflict

IntroductionBefore you startA backup is always advisedIf using a third-party builder or modal to embed the formIf the page is being cached or minified by a plugin or hosting companyTesting for Theme ConflictsTesting for Plugin Conflicts

Introduction
Gravity Forms uses WordPress』 best practices to make it as compatible as possible with all themes and plugins; however, some theme and plugin authors do not adhere to these best practices which can often result in a theme or plugin conflict with Gravity Forms.
The following sections provide instructions for determining if an issue you are experiencing with Gravity Forms is caused by a third-party. If you determine that your issue is not caused by a third-party following these instructions, please open a support ticket. If you were directed to this topic after having opened a ticket please reply to the ticket confirming that you have followed these steps and were still able to recreate this issue.
Before you start
A backup is always advised
It is advised to create a backup of your WordPress as good practise. Because you know what will happen the one time you forget this step…
If using a third-party builder or modal to embed the form
For the troubleshooting, you will want to create a test page, to embed your form directly using the WordPress form editor, without third-party builders or modal solutions.
Both WordPress Classic Editor and Gutenberg are supported.
If the page is being cached or minified by a plugin or hosting company
Caching and automatic JavaScript optimization techniques have been known to cause issues with plugins and even core WordPress features. It』s great to cache static pages to speed up loading times, but caching dynamic pages where you do changes often is not always a good practice. additionally, trying to automate the optimization of the scripts on the page without knowing each script』s needs is a possible way to break JavaScript related features.
So if your page is being cached or using any JavaScript related optimization done by a plugin, a CDN (e.g. CloudFlare, Sucuri, KeyCDN, etc) or your host using an internal proxy, Varnish, Redis object cache or any other caching engine, make sure to flush the cache and turn off caching and JavaScript optimizations completely during testing. Failure to do this can create false positives due to cached resources or the optimizations done.
Below you can find links to instructions to exclude your form page from caching for most used cached solutions
Breeze – CloudWays
CloudFlare
SG Optimizer
Sucuri
W3 Total Cache
WP-Optimize
WP Fastest Cache
WP Rocket
Some Hosts like WP Engine or Kinsta require the user to contact their support to request excluding the desired pages from their cache.
Fresh Forms for Gravity is a plugin that can help to deal with caching automatically in most cases.
Testing for Theme Conflicts
To test for a theme conflict:

Activate a default theme such as Twenty Thirteen, Fourteen, Fifteen, Sixteen, or Seventeen
Check to see if the issue still occurs

If the issue does not occur after having activated a default 「Twenty」 theme, your theme is causing a conflict with Gravity Forms.
If the issue continues to occur, you should then test for plugin conflicts.
Testing for Plugin Conflicts
To test for a plugin conflict:

Deactivate ALL plugins
Activate Gravity Forms
Check to see if the issue occurs

For multisite installations, you will need to ensure ALL plugins are disabled both on the sub-site Plugins menu (if it』s available) and the Network Admin Plugins page.
Also note Must-Use and Drop-ins plugins don』t have a deactivate option, if you have any of these installed, you will want to download their files to a safe place and remove them for testing.
If the issue does not occur, one (or more) of your plugins is causing a conflict with Gravity Forms. To determine which plugin(s) is causing the conflict, follow these steps:

Activate each plugin one by one
Check to see if the issue occurs after each plugin is activated

Taking a Screenshot of Your Feed Settings

Taking a Screenshot of Your Feed Settings

IntroductionNavigate To your Feed SettingsTaking A Screenshot

Introduction

Sometimes when requesting technical support, our Support Engineers (or the ticket form) may request a screenshot of your feed settings.

This small guide gives a little advice on taking a good screenshot.

Navigate To your Feed Settings

The feed settings we are interested in can be accessed by clicking the Settings button at the top of the form editor page.

Navigate to the form in question.Click or hover over Settings at top. Scroll down and choose the add-on you need help with. You will be presented with a screens showing a list of feeds for that add-on.Click Edit on the feed you need help with.

This will place you on the feed settings screen we need.

Taking A Screenshot

Most operating systems have some screenshot taking functionality built in. Here』s some help for the most popular OSs:

Mac → support articleWindows → help guide

Alternatively, there are dozens of good third party screenshot taking apps available in your application marketplace. Here』s one many that many of our Mac using team members love: https://cleanshot.com/

Make sure to include field mappings, options, and conditional logic in the image. Sometimes the feed settings are too large to get a single screenshot of it all. If your screenshot software cannot support full page screenshots, then zoom out the view of your browser first. CMD – (command key and minus/dash key) on MacOS or CTRL – (command key and minus/dash key) on Windows. You can also take multiple screenshots if it is clearer.

Now you should have something to send us. A good screenshot can really get Support Team excited!

Survey

Survey

SummaryCommon SettingsGeneral SettingsSurvey Field Type OptionsNotesAdditional Likert OptionsAdditional Single Line Text OptionsMerge TagsUsageModifiersSurvey Specific Merge Tags

Summary

The Survey field is available when using the Survey add-on and simply allows you to create survey questions that users can answer. It is available under the Advanced Fields section within the form editor. If you do not already have the Survey add-on installed, you』ll need to do so before this field is available.

Survey field as displayed in the Field Library

Survey field as displayed in the Form Editor, displaying the Likert choice type.

Common Settings

This field uses only common field settings for the Appearance and Advanced settings. For a description of each of the common field settings, refer to this article. Below you will find description of specialty settings that are particular to this field.

General Settings

SettingDescriptionSurvey QuestionThis is simply the question that you would like to ask the user.Survey Field TypeDetermines how the survey field will be displayed to the user. See note below for options.Columns/ChoicesThis is where you will define the individual answers for your survey field.

Survey Field Type Options

This table lists the options available for displaying your survey field to a user.

OptionMethod of ChoosingLikertSelect items from a scale of options. For example, a scale of options from Strongly Disagree to Strongly Agree. See notes. RankRank items within a list by dragging and dropping elements into a top-to-bottom order. RatingRate by stars. Each rating corresponds to a choice defined in the field settings. Radio ButtonsSelect one choice only by clicking a radio button. CheckboxesSelect one or multiple choices using checkboxes. Enable 「Select All」 creates a choice for the user to select all other choices.Single Line TextEnter one line of custom text. See notes.Paragraph TextSimilar to the Single Line Text option, but allows for multiple lines of input. Maximum Characters limits the number of characters this field is allowed to have.Drop DownDisplay choices in a dropdown box. Users can only select one.

Notes

Additional Likert Options

Enable Multiple Rows allows multiples Likert questions to be asked in the same survey, basically increasing the number of rows in the Likert table.

Enable Scoring allows different scores for each column. Aggregate scores are displayed in the results page and can be used in merge tags.

Additional Single Line Text Options

Input Mask provides a visual guide allowing users to more easily enter data in a specific format such as dates and phone numbers. For more information on input masks, refer to this article.

Merge Tags

For more information on the use of merge tags, refer to these articles.

Usage

{Field Name:2}

Modifiers

This field type does not have any modifiers available.

Survey Specific Merge Tags

TagDescription{survey_total_score}Displays the total score for the survey. Scoring must be enabled on the survey field for it to be tallied.{score:id=x}Displays the score for a specific survey question. Scoring must be enabled on the survey field for it to be tallied.