0
I’m using this example in the Lavarel form: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform?hl=pt-br
Works well, I do the fields autocomplete, but wanted to auto complete with an input type Hidden the latitude and longitude.
How can I take latitude and longitude, using this example of the link, and put an Hidden input to store these two data in my database?
On my form, I’m trying to take it this way:
<tr>
<td class="field-label"><b>Latitude</b></td>
<td class="wideField" colspan="3">
<input required class="field" name="latitude" id="lat" disabled="true"></input>
</td>
</tr>
In the
callback
of functionnavigator.geolocation.getCurrentPosition
you get the latitude and longitude, then just assign to theinput
s.– Lucas Fontes Gaspareto
I tried id= but it didn’t take...
– Ramos
Put the code, which you used, here so we can assist you.
– Lucas Fontes Gaspareto
@Lucas edited the question with the HTML snippet at the end...
– Ramos
Ramos, please, in the question, also enter the code
javascript
.– Lucas Fontes Gaspareto