Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top