Gravity Forms Tab Doesn’t Go to Next Field

By November 26, 2012 Productivity Tools, WordPress

Gravity FormsI started noticing a problem on a number of my Gravity Forms where if I was on the first field and pressed Tab, it would take me to a different area of the webpage and not to the next field. As someone who is accustomed to quickly filling out forms by pressing the tab key, this created a problem. The good news is that it is an easy fix.

Using an FTP manager or the WordPress Editor (Appearance > Editor), go to your functions.php file and add this code to the bottom of the file:

<?php add_filter("gform_tabindex", create_function("", "return 4;")); ?>

If a specific form is acting up for you, you can add code specific to that form. Find the Form ID number by clicking ‘Forms’ in the menu. To the left of your list of forms, you will find the ID per form. Replace the ‘5’ in the code below with the Form ID number.

<?php add_filter("gform_tabindex_5", create_function("", "return 4;"));?>

Test it out on your site to make sure it is working. Also, open up your WordPress admin area. Once I added the code, I noticed some error messages at the top of the screen in the WordPress admin area. I had to place the code in a different area of my functions.php file for it to work properly without the error codes.

Update: Forms in Widgets

Additionally, if one of your forms is in a widget, you can update the tab index within the widget area. After you add a Gravity forms widget to the page, click on the ‘advanced settings’ area and you can put in a number in the tab index area. If this form is the second form on your page (for instance, if it is in the footer and the other form is in the main content of the page, choose a number that is higher than the number of fields in your first form. It can even be much higher just to make sure the tab index works properly.

To test this out, go to the first form on your page. Enter info into the first field and then press tab to go to the next fields. It should go right in order.

Erik Rostad

Author Erik Rostad

Erik Rostad started EPR Creations in May 2008. He works with universities, international organizations, and executives on their online presence.

More posts by Erik Rostad

Join the discussion 9 Comments

Leave a Reply