-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gpaa-use-full-street-address.js
: Added snippet to use full street a…
…ddress for countries like Poland.
- Loading branch information
1 parent
0867ddf
commit 3ba10e5
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Gravity Perks // GP Address Autocomplete // Use Full Street Address | ||
* | ||
* For some countries like Poland, when entering an address with a street number, | ||
* the place result may sometimes truncate it. This snippet will prepend the street number if it is not | ||
* included in the result. | ||
* | ||
* http://gravitywiz.com/documentation/gravity-forms-address-autocomplete | ||
* | ||
* Instructions: | ||
* 1. Install our free Custom Javascript for Gravity Forms plugin. | ||
* Download the plugin here: https://gravitywiz.com/gravity-forms-custom-javascript/ | ||
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin. | ||
*/ | ||
window.gform.addFilter('gpaa_values', function(values, place, instance) { | ||
var fullAddress = instance.inputs.address1.value; | ||
values.address1 = fullAddress.split(',')[0].trim(); | ||
return values; | ||
}); |