Closed jensvandorpe closed 9 years ago
The input id is basically the one generated by symfony. It is affected in the buildView
and not the buildForm
, this is why your own value was always overridden.
IMO, what you want to customize is not the input id which represents the html input id but the javascript variable name. Am I right?
@egeloen I overlooked the buildView function, thanks
I can now easily change the variable name in the buildView function using $autocomplete->setJavascriptVariable("test");
Thanks alot
You can also affect it in the buildForm
(it does not matter).
I would like to implement this form autocomplete in our symfony project: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
But as the autocomplete input gets a generated id I cannot access it.
I found a function setInputId() in the following file: /vendor/egeloen/google-map/src/Places/Autocomplete.php but when I try to set it (just for testing) in the buildForm() function of /vendor/egeloen/google-map-bundle/Form/Type/PlacesAutocompleteType.php it doesn't seem to work.
Is there any reason this wasn't included in the default buildForm() function? And what could be a possible way to make this work?
Thanks in advance.
Jens