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 3rd party development.

Use this filter to customize the options shown in the new Autocomplete setting for Text type fields.

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.
  • $field (array)

Examples

Add additional autocomplete options

Use this code example to add additional autocomplete options for a specific field, e.g. Credit Card name.

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

	$options['cc-name'] = 'Credit card name';
	sort( $options );

	return $options;
}
add_filter( 'frm_autocomplete_options', 'add_custom_autocomplete_option_for_field', 10, 2 );
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 © 2025 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.

    Join 400,000+ using Formidable Forms to create form-focused solutions fast. Get Formidable Forms