Documentation

gform_tabindex

  1. Description
  2. Usage
  3. Parameters
  4. Examples
  5. Placement
  6. Source Code


Description

This filter is executed before the first field is displayed on the form. It can be used to change the tabindex start value or to disable the tabindex attribute.


Usage

Applies to all forms.

add_filter( 'gform_tabindex', '__return_false' );

Applies to a specific form. In this case, form Id 5.

add_filter( 'gform_tabindex_5', '__return_false' );


Parameters


Examples

This example changes form 10's tabindex start value to 4

add_filter( 'gform_tabindex_10', 'change_tabindex' , 10, 2 );
function change_tabindex( $tabindex, $form ) {
    return 4;
}

This example disable tabindex for all forms

add_filter( 'gform_tabindex', '__return_false' );


Placement

This code should be placed in the functions.php file of your active theme.


Source Code

This filter is located in GFFormDisplay::get_form() in form_display.php