Skip to content

Commit b45d50a

Browse files
authored
gpaa-gf-address-enhanced.js: Migrated.
1 parent a1c7410 commit b45d50a

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,5 @@
11
/**
2-
* Gravity Perks // GP Address Autocomplete // Populate State/Province Drop Down for GF Address Enhanced
3-
* https://gravitywiz.com/documentation/gravity-forms-address-autocomplete
4-
*
5-
* Add support for automatically selecting the state/province when using the Gravity Forms Address Enhanced plugin.
6-
* GF Address Enhanced does not preserve the populated value in the input when the field is converted
7-
* into a select after the country is automatically populated by GPAA.
8-
*
9-
* Instructions:
10-
* 1. Install our free Custom JavaScript for Gravity Forms plugin.
11-
* Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
12-
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
2+
* We're no longer using the experimental folder for experimental snippets. 🚧
3+
* You can now find the snippet here:
4+
* https://github.com/gravitywiz/snippet-library/blob/master/gp-address-autocomplete/gpaa-gf-address-enhanced.js
135
*/
14-
gform.addAction('gpaa_fields_filled', function (place, instance, formId, fieldId) {
15-
place.address_components.forEach( function( component ) {
16-
if ( component.types.indexOf( 'administrative_area_level_1' ) !== -1 ) {
17-
// Update "1" to the field ID in which you would GPAA and GF Address Enhanced enabled
18-
$( '#input_GFFORMID_1_4 option[value="' + component.short_name + '"]' ).attr('selected', 'selected');
19-
}
20-
} );
21-
} );

0 commit comments

Comments
 (0)