Skip to content

Commit 3ba10e5

Browse files
authored
gpaa-use-full-street-address.js: Added snippet to use full street address for countries like Poland.
1 parent 0867ddf commit 3ba10e5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Gravity Perks // GP Address Autocomplete // Use Full Street Address
3+
*
4+
* For some countries like Poland, when entering an address with a street number,
5+
* the place result may sometimes truncate it. This snippet will prepend the street number if it is not
6+
* included in the result.
7+
*
8+
* http://gravitywiz.com/documentation/gravity-forms-address-autocomplete
9+
*
10+
* Instructions:
11+
* 1. Install our free Custom Javascript for Gravity Forms plugin.
12+
* Download the plugin here: https://gravitywiz.com/gravity-forms-custom-javascript/
13+
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
14+
*/
15+
window.gform.addFilter('gpaa_values', function(values, place, instance) {
16+
var fullAddress = instance.inputs.address1.value;
17+
values.address1 = fullAddress.split(',')[0].trim();
18+
return values;
19+
});

0 commit comments

Comments
 (0)