ok. So, i'm working on this custom google maps API branch locator for
my company. I am a marketing employee with a descent amount of code
knowledge, but still not the craftiest. So far I have managed to do
some HEAVY customization of our 'branch locator' on my own, but am
still confused on one part of it.

Here is where the project starts...

http://wesco.jp-clients.com/branch_locate/branch_lists/branch_list.php

>From there, you click on a state or area, and it takes you to a
dynamic page with a list of the branches in that area, and then from
there you can click a branch, and it will take you to a page with just
that branch located on the map. This part of the project is COMPLETE.
>From there, next to the branch info, there is an image that says
"click here for more comprehensive search".

The above link will direct you here...

http://wesco.jp-clients.com/branch_search/index.php

This is the page where I am in desperate need of some help. In my
database, there is a name, and address field, as well as branch ID and
region code. So far, when you search, you can type in a city, or
zipcode, or address, and it will find the nearest branches based on
that.

What im trying to do, is add some search parameters to this search
function. I had made a previous post about this, but i still havent
solved this issue yet. Apparently the person who tried to help thought
that for some reason I should already know everything about code, and
that if you dont then your not allowed to post in a help forum, but
that doesnt make sense because if no one needed help, there wouldnt be
a help forum.... but anyways...

I need to figure out a way to customize this function....

 function searchLocations() {
     var address = document.getElementById('addressInput').value;
     geocoder.getLatLng(address, function(latlng) {
       if (!latlng) {
         alert(address + ' not found');
       } else {
         searchLocationsNear(latlng);
       }
     });
   }

...so that it can search by address, but ALSO search by branch ID as
well...

What i picked up from my previous post, is that i need to write some
sort of javascript to FIRST CHECK to see if i had entered a number or
not, then based on what was typed in, run a search. I found some code
to check to see if a number has been entered....

function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;


   for (i = 0; i < sText.length && IsNumber == true; i++)
      {
      Char = sText.charAt(i);
      if (ValidChars.indexOf(Char) == -1)
         {
         IsNumber = false;
         }
      }
   return IsNumber;

   }

....also in my previous post, the gentlemen had explained this to
me....

 function searchLocations() {
     var address = document.getElementById('addressInput').value;
by adding something like
     var numeric = do-some-thing
(address);
     if (numeric) {
        alert("hey it's a number");
     }
     else
     {   // it's not a number so
        geocoder......  ;
        if (!latlng) {
           ....
        }
     }

} // end function

    function do-some-thing
( string ) {
     // here goes a simple test of a string to see if it is only
numeric
     // and returns true or false
     // If you get that working you can enhance later to test if its a
four-digit number

} // end function


IN CONCLUSION.....can anybody help me piece all this code together
into one solid function? I have all the pieces, i just cant figure out
how to put it all together...any help would be greatly
appreciated...but...

DONT REPLY if your just going to try to make me feel stupid for not
already knowing how to do this. If everyone knew how to use google
API's already, this forum wouldnt exist. I dont like feeling stupid
for asking for HELP in a HELP forum.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to