ok, i understand exactly what your saying, i appreciate you elaborating on that, made more sense to me, but unfortunately, i still am shit at writing this stuff, could you perhaps provide me with an example of some sort of exactly what you mean? was i right with the if/ else/else/ idea? i think im still off
On Aug 10, 4:30 pm, Rossko <[email protected]> wrote: > > ok, i see what your saying, but unfortunately i am straight shit when > > it comes to writing custom javascript... > > Google Maps makes a poor training ground, people tend to get in way > over their heads with ideas that are difficult to implement before > they've mastered the basics. > > > 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" > > No, what searchLocations() does at the moment is > get the content of ''addressInput' > whether or not there was anything meaningful, geocode it. > if the geocode fails, complain. > if the geocode works, run searchLocationsNear() > > if searchLocationsNear() gets an empty result, display 'results not > found'. > > > 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' > > Kind of ; I'd be inclined to test first if the user entered a number > (that's easy to define) as it is hard to test what an address looks > like. It's pretty pointless geocoding a branch-id to see if fails, > and it might give unexpected results if the geocoder matches it up to > say a zipcode ... > > http://www.google.co.uk/search?hl=en&q=javascript+test+string+for+num... > > If it's a number, do whatever you need to do for direct branch-id > access. That might mean doing a redirect to that direct-branch page > you were working on before. Or it might mean doing a psuedo-search by > GDownloadUrl for a given branch-id and using it on the same page. > That's your design decision. > Make sure your page / php script does something sensible if its fed an > invalid branch-id! > > Else if it's not a number, do your geocoding with pass or fail result > exactly as before. > > Once it's working, you could enhance your numeric test to treat only 4- > digit numbers as branches, in case an end user DOES enter a zipcode, I > hadn't thought of that before. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
