
function geocodeLocation() {
    var ajson = "https://maps.googleapis.com/maps/api/geocode/json?address=" + $('[name=location]').val()
    $.ajax({
        dataType: "json",
        url: ajson,
        success: function(d) {
            z = d.results[0].geometry.location
            $('[name=location_lat]').val(z.lat);
            $('[name=location_lng]').val(z.lng);
        }
    });
}
