开发者

Auto populate city textfield by entering zip and vice versa

开发者 https://www.devze.com 2023-01-20 23:07 出处:网络
I\'ve seen that this question开发者_JAVA百科 has been posted a couple of times but nothing specific enough for me to use.

I've seen that this question开发者_JAVA百科 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消