Jump to content

populate state dropdown based on zip input


cchhita

Recommended Posts

Hi Everyone,

I am new to Ajax so trying to learn the ropes.

What I have managed to do is create a database lookup with Ajax, so everytime someone enters a zip code, it will automatically fill in the appropriate city and state for me in text boxes.  This process works fine, but now I have to use this data to send to a second page, which is where I am having troubles.

 

All I want, is the first page that asks the user for their zip.

Once they enter the zip and they hit the submit button, it should take them to a second page, where the zip, city and State are prepopulated for them.

 

Also, I want the State field to be a dropdown list, so if the details are incorrect, or they entered the zip wrong in the first step, they can correct the information here.

 

I have to send the form to a third party, so the names and the exact text string I send to the third part has to be exactly right, otherwise it will be rejected by the system, that is why I need to have a dropdown for the state and not an open text field. 

I.e. If the box is an open text field and they type in TX instead of Texas, then the form will be rejected.

 

Is there an easy way to do this, or can someone point me in the right direction?

 

Thanks in advance

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.