ok, i see what your saying, but unfortunately i am straight shit when
it comes to writing custom javascript...
here's what i have already...
function searchLocations() {
var address = document.getElementById('addressInput').value;
geocoder.getLatLng(address, function(latlng) {
if (!latlng) {
alert(address + ' not found');
} else {
searchLocationsNear(latlng);
}
});
}
from what i see, that basically says, "if the user clicks the button
without entering an address,...or they enter an area that doesnt
contain a location within the given radius, echo 'results not found',
but if they do, find the locations"
so i guess i would have to write something like "if the user enters an
address...search the address...but IF they enter a 4 digit numeric
value, search based on the 'branch_id' row, and if they enter nothing,
echo 'results not found'
so i would take this from an IF/ELSE to and IF/ELSE/ELSE?
On Aug 10, 2:59 pm, Rossko <[email protected]> wrote:
> > Here is the map as is...
>
> >http://wesco.jp-clients.com/branch_search/index.php
>
> > Right now, you can search by city or state, and thats it. But i would
> > ALSO like it to be able to search by branch_id, which is one of the
> > table rows in my database. It's a simple 4 digit identifier,
> > completely seperate from the regular id.
>
> In the current page, poking the 'search' button executes
> searchLocations().
> searchLocations() blindly geocodes whatever is in the 'addressInput'
> box.
> You want it to do something different depending on what is actually
> gven in the 'addressInput' box, so change your searchLocations() to
> analyse it first.
> Write some javascript to do a simple analysis on the string from
> 'addressInput'.
> If it's wholly numeric, do whatever you have to do to treat it as
> branch id.
> If it's not, geocode it as before.
>
> While you're there, you could usefully add some error detection to
> provide hints to the user; e.g. if they supply a 3-digit number, or
> nothing - don't process it but tell them what you expected.
>
> Not a maps question.
>
> cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---