Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Can this be done ?

Hi all, need some guidance here, need to know if this is achievable.

Site is being developed in PHP.

During the process of filling out a 'sign-up' form, I want users to enter their zip code. Based on the zip code they entered, the next two fields (town and state) are automatically populated (I'm thinking java-script, but not sure). In the case of TOWN it may be a drop-down list with two or three town options, but the list is populated based on the corresponding zip code.

Any suggestions appreciated.

Thanks in advance.

Regards
W
[602 byte] By [byebyecharlie] at [2007-11-11 7:55:20]
# 1 Re: Can this be done ?
JavaScript is not Java. But yes, this is commonly donw using JavaScript. You could populate the page itself with all the data it needs to dynamically update town and state, or the zip field can send another request to the server for the PHP file to do this calculation and respond with a new page with the town and state fields filled in.

Exactly how to do it is probably a better question for a JavaScript forum, or by searching the web. This is a very common application, so I'd expect there to be examples available.

Also, if you see a web site that does this, examine their HTML source to see how they're doing it.
Laszlo at 2007-11-11 22:36:56 >