Jump to content

Form Question


JSHINER

Recommended Posts

I believe this is done with PHP...

I want two form fields, first, a State Selection, so you choose a state. Then dependent on the state you choose, the next field, Towns, has the list of towns for that state. I have all the states/towns already, I just need the basic code to perform that action. Also, when you select a Town I want it to automatically link to a specified link.

Any help / pointers in the right direction would be much appreciated.

Thank you!
Link to comment
Share on other sites

No it isn't really php it is Javascript that you need. The user will select in the first and you need javascript to update the second. You will have to pre-load all of the towns when the page loads unless you use AJAX which is a combination of php and style sheet and javascript. This way by using an invisible frame you can use a get to query the database return only the towns you need and use javascript to pull the list into the next select. It is quite a long and difficult proccess if you haven't done it before.
Link to comment
Share on other sites

Have a look at the Ajax implementation of your request at Chained Select Boxes at [url=http://www.dhtmlgoodies.com/index.html?page=ajax]http://www.dhtmlgoodies.com/index.html?page=ajax[/url].
See also the demo at [url=http://www.dhtmlgoodies.com/scripts/ajax-chained-select/ajax-chained-select.html]http://www.dhtmlgoodies.com/scripts/ajax-chained-select/ajax-chained-select.html[/url]

Ronald  8)
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.