My form elements are functioning perfectly:
<input id="addressinput1" style="width:20%" value="Enter Address"/>
<input id="showaddress1" type="button" value="Show Tech Home" style="width:10%"/>
The code above successfully triggers the following JavaScript when the address input is changed to:
<select name="addressinput1" style="width:20%">
<option value="my address">my address</option>
</select>
After attempting to change
$("#showaddress1").click(geoCode1);
from click to change, there was no effect. What could be the issue?
function geoCode1(){
var address = $("#addressinput1").val();
geocoder = new google.maps.Geocoder();
if(geocoder){
geocoder.geocode({ 'address': address }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
// Code for displaying map marker here
}
else if(status == google.maps.GeocoderStatus.ZERO_RESULTS){
// Handle case where no results were found
}
});
}
}
// Document ready function with various actions and event listeners
$(document).ready(function(){
// Additional functions and configurations
});
Thanks,