gpaa_field_autocomplete_value (JS)

  1. Description
  2. Usage
  3. Parameters
  4. Since
  5. Examples
    1. Set a custom autocomplete attribute value for the “address1” field.

Description

Filters the value for an input’s autocomplete attribute. (Defaults to “off”)

See the MDN reference for all possible values.

Usage

window.gform.addFilter( 'gpaa_field_autocomplete_value', 'my_custom_function' );

Parameters

Since

This filter is available since Gravity Forms Address Autocomplete 1.2.23.

Examples

Set a custom autocomplete attribute value for the “address1” field.

window.gform.addFilter( 'gpaa_field_autocomplete_value', function(
	autocompleteVal,
	input,
	inputName,
	gpaaInstance,
	formId,
	fieldId
) {
	if ( inputName === 'address1' ) {
		return 'shipping street-address';
	}

	return autocompleteVal;
} );