gpaa_field_autocomplete_value (JS)
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
autocompleteVal string
Value for the autocomplete attribute.
input HTMLInputElement
The input element.
inputName string
The name of the input element.
instance GP_Address_Autocomplete
Current instance of the class.
formId number
The current form ID.
fieldId number
The current field ID.
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;
} );