Skip to content

Commit 37cc078

Browse files
authored
gpaa-show-place-name.js: Updated snippet to append place name to the street address rather than replace it.
1 parent a29b084 commit 37cc078

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gp-address-autocomplete/gpaa-show-place-name.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ gform.addFilter( 'gpaa_autocomplete_options', function( options ) {
2020

2121
// Display Place Name
2222
gform.addAction( 'gpaa_fields_filled', function ( place, instance, formId, fieldId ) {
23-
jQuery( '#input_{0}_{1}_1'.gformFormat( formId, fieldId ) ).val( place.name ).trigger('change');
23+
let $addressLine1 = jQuery( '#input_{0}_{1}_1'.gformFormat( formId, fieldId ) );
24+
$addressLine1.val( place.name + ', ' + $addressLine1.val() ).trigger('change');
2425
} );

0 commit comments

Comments
 (0)