Docs & Support

Learn about all the Formidable features and get support from our amazing customer success team.

frm_focus_error_summary

Heads up! This article contains PHP code and is intended for developers. We offer this code as a courtesy, but don't provide support for code customizations or third-party development.

Use the frm_focus_error_summary filter to stop the clickable list of field errors from taking focus after a failed submission. The list stays on the form. Focus moves to the first field with an error instead.

The filter only runs on a form that shows the list. There, by default, the error message at the top of the form receives focus, so visitors start at the full list of errors. Forms show the list by default. On a form where the list is turned off, focus already goes to the first field with an error.

Requirements

  • Formidable Forms 7.0 or later.
  • The filter is in Formidable Forms Lite, so it works with or without Formidable Forms Pro.

Formidable Forms makes advanced site building simple. Launch forms, directories, dashboards, and custom WordPress apps faster than ever before.

Usage

add_filter( 'frm_focus_error_summary', '__return_false' );

Parameters

  • $focus_summary (bool): Whether the error message at the top of the form receives focus. Default true.
  • $form (object): The form being shown. It's always set, because the filter only runs for a form that shows the list.

Examples

Learn where to put the code when adding a custom PHP function to your site.

Focus the first field with an error on every form

This example keeps the error list but moves focus to the first field with an error, as before 7.0. Use it to take visitors straight to the field that needs fixing.

add_filter( 'frm_focus_error_summary', '__return_false' );

Focus the first field with an error on one form

Replace 123 with the ID of your form.

add_filter( 'frm_focus_error_summary', 'my_focus_first_field_for_form', 10, 2 );
function my_focus_first_field_for_form( $focus_summary, $form ) {
	if ( (int) $form->id === 123 ) { // Change 123 to the ID of your form.
		return false;
	}

	return $focus_summary;
}

Limitations

  • The filter only changes where focus goes. Field errors still don't get role="alert" while the list is on.
  • Returning true from the frm_focus_first_error filter doesn't move focus while this filter returns true. The error list keeps focus, and WordPress shows a "doing it wrong" notice when debugging is on.
Was this article helpful? *

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

In this article

    We have a small, but amazing team of dedicated people who are committed to helping you achieve your goals and project requirements.


    Copyright © 2026 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Complete your purchase
    Don't forget your purchase!
    Complete Purchase
    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms