Skip to content

Instantly share code, notes, and snippets.

@spivurno
Last active March 14, 2019 13:47
Show Gist options
  • Save spivurno/4661036 to your computer and use it in GitHub Desktop.
Save spivurno/4661036 to your computer and use it in GitHub Desktop.
Gravity Wiz // Fix Gravity Form Tabindex Conflicts ~ http://gravitywiz.com/fix-gravity-form-tabindex-conflicts/
<?php
/**
* Fix Gravity Form Tabindex Conflicts
* http://gravitywiz.com/fix-gravity-form-tabindex-conflicts/
*/
add_filter( 'gform_tabindex', 'gform_tabindexer', 10, 2 );
function gform_tabindexer( $tab_index, $form = false ) {
$starting_index = 1000; // if you need a higher tabindex, update this number
if( $form )
add_filter( 'gform_tabindex_' . $form['id'], 'gform_tabindexer' );
return GFCommon::$tab_index >= $starting_index ? GFCommon::$tab_index : $starting_index;
}
@dohnutt
Copy link

dohnutt commented Mar 27, 2017

Isn't it better to set the tabindex to "0" instead of a high number? 0 will put the form in the flow of the page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment