Answer the question
In order to leave comments, you need to log in
How to process a form without a click?
Hello, I'm registering in the application and I want the coordinates and address from the Google database to be entered into the fields when entering the address. Backend on Django.
Here is the form
<input class="form-control" id="address" type="text" >
<input type="submit" onclick="codeAddress(); return false; " class="btn btn-success" value="Отправить">
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
var addressOne = results[0].formatted_address;
var addressTwo = results[0].address_components[2].long_name;
var location = results[0].geometry.location;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question