We help IT Professionals succeed at work.

enter zipcode and display city dropdown and state pulling from mysql using php and AJAX

brad0525
brad0525 asked
on
Hello I have a database that has all the zipcodes in the us. The problem I am having is that I have a script that returns the city and state when the zip code is entered but I need a drop down menu for the city so the user and select from which city they are in based on their zip code. I need this to use ajax so the page doesnt have to refresh...If you have a sample code that would be great as I can modify it for my needs..thanks
Comment
Watch Question

Hi,


Refer this url

http://www.webpasties.com/xmlHttpRequest/

I hope this is useful to you


Thanks
Gary

Author

Commented:
I already have this system working. I need a system that produces a drop down for the city. I need the user to be able to choose which city based on their zip code...

Commented:
Why would you need this. Are there zip codes that cover more than one city?

Author

Commented:
Yes there are

Author

Commented:
The URL is a great example, it required some tweaking and additional code but it is a great start.