views:

13

answers:

1

Hi guys,

I've seen that this question has been posted a couple of times but nothing specific enough for me to use.

I have a form (In a .php file), with a Zipcode and City textfield. I also have a seperate database which holds all zipcodes and cities for my country. (Zipcode in column 1 and city in column 2)

What i would like is that whenever a user inputs either city or zipcode the other field updates/populates automatically based on the database.

I've tried looking for a jquery / ajax solution, but i haven't found one yet.

+1  A: 

AJAX can do the trick. You may try something like this: LINK.

I suggest you to use jQuery, it's much cleaner code for AJAX than coding it yourself.

mdrg
Thank you very much, i will look into that link!
MadsK
Worked like a charm! Thank you ;)
MadsK