Docs & Support

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

frm_autocomplete_options

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_autocomplete_options filter to customize the options shown in the Autocomplete setting for Text, Email, and Number fields. The setting is in the collapsed Advanced section of the field's Field Options.

Since Formidable Forms 7.0, the Autocomplete setting is part of Formidable Forms Lite, so this filter runs with or without Formidable Forms Pro.

Usage

add_filter( 'frm_autocomplete_options', 'add_custom_autocomplete_option_for_field', 10, 2 );

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

Parameters

  • $options (array): All of the options in the Autocomplete setting, as autocomplete value => label (for example, 'email' => 'Email'). The list already fits the field type: a Number field only gets number values, such as 'bday-year' and 'postal-code'. The list also starts with 'on' => 'On' and 'off' => 'Off'.
  • $field (array): The field the setting belongs to.

Examples

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

Add additional autocomplete options

Use this code example to add additional autocomplete options for a specific field, such as Credit card name. Replace 13 with the ID of your field. The field ID shows next to the field name at the top of the Field Options tab.

The asort() line sorts the whole list by label. This moves On and Off from the top into the middle of the list.

/**
 * @param array $options
 * @param array $field
 */
function add_custom_autocomplete_option_for_field( $options, $field ) {
	$target_field_id = 13; // change 13 to your field ID
	if ( $target_field_id !== (int) $field['id'] ) {
		return $options;
	}

	$options['cc-name'] = 'Credit card name';
	asort( $options ); // Sort by label and keep the autocomplete values as keys.

	return $options;
}
add_filter( 'frm_autocomplete_options', 'add_custom_autocomplete_option_for_field', 10, 2 );

Change Log

  • Version 7.0: runs in Formidable Forms Lite, for Text, Email, and Number fields.
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