Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Vitaminwater

macrumors newbie
Original poster
Aug 18, 2009
21
0
Good Afternoon All,

Currently I am trying to create a form that requires user input in the form of a postal code (ie 06515, 95010 etc). I currently have a database full of zipcodes, their associated state name, and lots of other information about it.

I'm trying to set up my form so that when a user enters a certain zipcode say, 06515, some text appears next to the textbox containing the correct information from the database.

Thanks for your help!
 
Well you'll add an event handler for maybe the onblur event for the text field, then use AJAX to connect server side and query the DB, and return the info and place it where you want on the page.

How much JavaScript do you know? You likely won't be able to find a pre-built solution so you will need to know JavaScript and a server side language like PHP for interacting with the DB. So what specifically do you need help with?
 
Thanks for the response.

I'm all set with communicating with my mysql db using php. I know some light javascript, but where I start to lose traction is setting up the ajax to work with the mysql php code.

Any help is appreciated. Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.