PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Automatic Tab Index for new forms

  1. I have a client that will be using GravityForms to insert forms on a constant basis onto various new pages across their site. Problem is, every time they input a new form, the tab index is not created for that particular form and I need to edit their functions.php to fix this. Ultimately, they don't want to have to have me do this each time they create a new form. Is there a way to have this process more automatic, where a new form receives a new tab index automatically?

    Posted 10 years ago on Monday October 8, 2012 | Permalink
  2. Edit the functions.php one time to set a high tabindex for all Gravity Forms, rather than specific Gravity Forms, like this:

    add_filter("gform_tabindex", create_function("", "return 75;"));

    That will start every Gravity Form with a tabindex of 75. Does that work for you? It only needs to be done once, and so long as there are no forms on the page with more than 75 form fields, this will be fine. Normally there is a comment form or contact us form, and those typically have just 3 or 4 fields, so 75 should be plenty high enough.

    Posted 10 years ago on Monday October 8, 2012 | Permalink
  3. Close, but we have multiple forms on pages sometimes. In this particular case, we have one in the footer that is always there (newsletter signup) and it keeps grabbing the tab since it shares the same index. Is there a way around this?

    Posted 10 years ago on Monday October 8, 2012 | Permalink
  4. How are you including the one which is always in the footer? If you are using the shortcode, you can set the tabindex there; set it to 30 or something. If you are using a form widget, you can set the tabindex there as well. And if it is hard coded into the template, you can set the tabindex in the function call. Do any of those work for you?

    Let us know how you embedded the form in the footer.

    Posted 10 years ago on Monday October 8, 2012 | Permalink
  5. Chris, so sorry for not responding sooner. Yes, this did fix the problem, thank you!

    Posted 10 years ago on Tuesday October 16, 2012 | Permalink

This topic has been resolved and has been closed to new replies.