' . sprintf( esc_html__( 'For information about the following settings and additional solutions for detecting spam, see the %1$sSpam Detection and Protection documentation%2$s.', 'gravityforms' ), '', $open_in_new_tab . '' ) . '
'; $fields = array( 'form_basics' => array( 'title' => esc_html__( 'Form Basics', 'gravityforms' ), 'fields' => array( array( 'name' => 'title', 'type' => 'text', 'label' => esc_html__( 'Form Title', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_title', '', true ), 'required' => true, 'validation_callback' => function ( $field, $value ) use ( $form ) { // If value is empty, set error. if ( rgblank( $value ) ) { $field->set_error( rgobj( $field, 'error_message' ) ); return; } // Get forms. $forms = GFFormsModel::get_forms(); // Loop through forms, look for duplicate title. foreach ( $forms as $f ) { // If form does not have a duplicate title, skip. if ( strtolower( $f->title ) !== strtolower( $value ) ) { continue; } // If form ID matches, skip. if ( (int) $form['id'] === (int) $f->id ) { continue; } // Set field error. $field->set_error( esc_html__( 'The form title you have entered has already been used. Please enter a unique form title.', 'gravityforms' ) ); return; } $field->do_validation( $value ); }, ), array( 'name' => 'description', 'type' => 'textarea', 'label' => esc_html__( 'Form Description', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_description', '', true ), 'allow_html' => true, ), ), ), 'form_layout' => array( 'title' => esc_html__( 'Form Layout', 'gravityforms' ), 'fields' => array( array( 'name' => 'labelPlacement', 'type' => 'select', 'label' => esc_html__( 'Label Placement', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_label_placement', '', true ), 'choices' => array( array( 'label' => __( 'Top aligned', 'gravityforms' ), 'value' => 'top_label', ), array( 'label' => __( 'Left aligned', 'gravityforms' ), 'value' => 'left_label', ), array( 'label' => __( 'Right aligned', 'gravityforms' ), 'value' => 'right_label', ), ), 'conditional_descriptions' => array( array( 'values' => array( 'left_label', 'right_label' ), 'description' => sprintf( $accessibility_warnings(), esc_html__( 'It is easiest for users to understand your form when the labels are placed above the inputs. Set the label placement to "Top aligned" to improve the accessibility of your form.', 'gravityforms' ), esc_html__( 'Learn More', 'gravityforms' ), esc_html__( '(opens in a new tab)', 'gravityforms' ) ), ), ), ), array( 'name' => 'descriptionPlacement', 'type' => 'select', 'label' => esc_html__( 'Description Placement', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_description_placement', '', true ), 'dependency' => array( 'live' => true, 'fields' => array( array( 'field' => 'labelPlacement', 'values' => array( 'top_label' ), ), ), ), 'choices' => array( array( 'label' => __( 'Below inputs', 'gravityforms' ), 'value' => 'below', ), array( 'label' => __( 'Above inputs', 'gravityforms' ), 'value' => 'above', ), ), 'conditional_descriptions' => array( array( 'values' => array( 'below' ), 'description' => sprintf( $accessibility_warnings(), esc_html__( 'It is easiest for users to understand your form when the descriptions are placed above the inputs. Set the description placement to "Above" to improve the accessibility of your form.', 'gravityforms' ), esc_html__( 'Learn More', 'gravityforms' ), esc_html__( '(opens in a new tab)', 'gravityforms' ) ), ), ), ), array( 'name' => 'validationPlacement', 'type' => 'select', 'label' => esc_html__( 'Validation Message Placement', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_validation_placement', '', true ), 'choices' => array( array( 'label' => __( 'Below inputs', 'gravityforms' ), 'value' => 'below', ), array( 'label' => __( 'Above inputs', 'gravityforms' ), 'value' => 'above', ), ), 'conditional_descriptions' => array( array( 'values' => array( 'below' ), 'description' => sprintf( $accessibility_warnings(), esc_html__( 'It is easiest for users to understand your form when validation messages are placed above the inputs. Set the validation message to "Above" to improve the accessibility of your form.', 'gravityforms' ), esc_html__( 'Learn More', 'gravityforms' ), esc_html__( '(opens in a new tab)', 'gravityforms' ) ), ), ), ), array( 'name' => 'subLabelPlacement', 'type' => 'select', 'label' => esc_html__( 'Sub-Label Placement', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_sub_label_placement', '', true ), 'choices' => array( array( 'label' => __( 'Below inputs', 'gravityforms' ), 'value' => 'below', ), array( 'label' => __( 'Above inputs', 'gravityforms' ), 'value' => 'above', ), ), 'conditional_descriptions' => array( array( 'values' => array( 'below' ), 'description' => sprintf( $accessibility_warnings(), esc_html__( 'It is easiest for users to understand your form when the sub-labels are placed above the inputs. Set the sub-label placement to "Above" to improve the accessibility of your form.', 'gravityforms' ), esc_html__( 'Learn More', 'gravityforms' ), esc_html__( '(opens in a new tab)', 'gravityforms' ) ), ), ), ), array( 'name' => 'validationSummary', 'type' => 'toggle', 'label' => esc_html__( 'Validation Summary', 'gravityforms' ), 'tooltip' => gform_tooltip( 'validation_summary', '', true ), 'conditional_descriptions' => array( array( 'values' => array( false ), 'description' => sprintf( $accessibility_warnings(), esc_html__( 'It is easiest for users to find all of the validation errors in one place. If your form has more than two fields, enable the Validation Summary to improve accessibiility of your form.', 'gravityforms' ), esc_html__( 'Learn More', 'gravityforms' ), esc_html__( '(opens in a new tab)', 'gravityforms' ) ), ), ), ), array( 'name' => 'requiredIndicator', 'label' => esc_html__( 'Required Field Indicator', 'gravityforms' ), 'type' => 'radio', 'horizontal' => true, 'tooltip' => gform_tooltip( 'form_required_indicator', '', true ), 'choices' => array( array( 'label' => esc_html__( 'Text: (Required)', 'gravityforms' ), 'value' => 'text', ), array( 'label' => esc_html__( 'Asterisk: *', 'gravityforms' ), 'value' => 'asterisk', ), array( 'label' => esc_html__( 'Custom:', 'gravityforms' ), 'value' => 'custom', ), ), 'conditional_descriptions' => array( array( 'values' => array( 'asterisk', 'custom' ), 'description' => sprintf( $accessibility_warnings(), esc_html__( 'The asterisk required field indicator might not be clear to all users. Set the required field indicator to "Text" to improve the accessibility of your form.', 'gravityforms' ), esc_html__( 'Learn More', 'gravityforms' ), esc_html__( '(opens in a new tab)', 'gravityforms' ) ), ), ), ), array( 'name' => 'customRequiredIndicator', 'type' => 'text', 'label' => esc_html__( 'Custom Required Indicator', 'gravityforms' ), 'default_value' => esc_html__( '(Required)', 'gravityforms' ), 'dependency' => array( 'live' => true, 'fields' => array( array( 'field' => 'requiredIndicator', 'values' => array( 'custom' ), ), ), ), ), array( 'name' => 'cssClass', 'type' => 'text', 'after_input' => $deprecated_confirmation_classes_field_notice, 'label' => esc_html__( 'CSS Class Name', 'gravityforms' ), 'tooltip' => gform_tooltip( 'form_css_class', '', true ), ), ), ), 'save_and_continue' => array( 'title' => esc_html__( 'Save and Continue', 'gravityforms' ), 'fields' => array( array( 'name' => 'saveEnabled', 'type' => 'toggle', 'label' => __( 'Enable Save and Continue', 'gravityforms' ), ), array( 'name' => 'saveButtonText', 'type' => 'text', 'label' => esc_html__( 'Link Text', 'gravityforms' ), 'default_value' => __( 'Save & Continue', 'gravityforms' ), 'dependency' => array( 'live' => true, 'fields' => array( array( 'field' => 'saveEnabled', ), ), ), 'description' => sprintf( '%s
%s