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
https://forums.phpfreaks.com/topic/21659-form-question/
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
https://forums.phpfreaks.com/topic/21659-form-question/#findComment-96698
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
https://forums.phpfreaks.com/topic/21659-form-question/#findComment-96745
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.