Closed soerenmartius closed 8 years ago
Thx for reporting this! Basically, I would say you should use events. The problem is the events are only usable with a map... I think we should add this feature to the places autocomplete too.
For now, if you're using the places autocomplete as standalone, you can override the twig form block and append your own js line (See https://developers.google.com/maps/documentation/javascript/events for how using the places autocomplete events).
Your issue has been fixed in #159 but will only be part of the 3.x version of the bundle.
As already suggested, the solution is to use events. Something like the following would do the job:
$builder->add('field', PlaceAutocompleteType::class, [
'variable' => $variable = 'acme_place_autocomplete',
'events' => [new Event(
$variable,
'place_changed',
'function () { /* Handle your automatic form submission... */ }'
)]
]);
Hi,
Whats the best way to submit the current form after a list entry was chosen? I dont want users to have to click on a submit button if the form only contains the places autocomplete field.
Thank you