function getLocationFromZip(form) { var searchValue = form.storesListZipCode.value; searchValue = $.trim(searchValue); if (searchValue == null || searchValue == "") { if(form.action != null && !form.action.endsWith("billing.cmd")){ alert("Please enter a ZIP code."); } return false; } searchValue = $.trim(searchValue); if(!isZipCode(searchValue)) { if(form.action != null && !form.action.endsWith("billing.cmd")){ alert("Please enter a valid ZIP code."); } return false; } // // Display Loader // $("#loading").show(); $("#loading").appendTo('body').css({'position':'absolute', 'z-index':'1999', 'width' : 'auto', 'height' : 'auto' }); lib.layer.center( "#loading" ); $("#loading").css('top','275px'); site.func.globalOverlay.create(); // // we dont know what the coords are so go to google to grab // them. // MyMapGeocode( searchValue, function(geocode) { if (!geocode) { // // what we have here... is.. a failure to communicate // form.storesListLatitude.value = '-1'; form.storesListLongitude.value = '-1'; } else { // // populate the form // // alert( geocode.lat() + " " + geocode.lng() ); // form.storesListLatitude.value = geocode.lat; form.storesListLongitude.value = geocode.lng; } if (navigator.userAgent.indexOf('Mac') != -1) { setTimeout(function() { form.submit();}, 500); } else { form.submit(); } // // Remove Loader // } ); return false; }