Jump to content


Photo

Form Question


  • Please log in to reply
3 replies to this topic

#1 JSHINER

JSHINER
  • Members
  • PipPipPip
  • Advanced Member
  • 465 posts
  • LocationBoston, MA

Posted 22 September 2006 - 01:16 PM

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!

#2 steveclondon

steveclondon
  • Members
  • PipPipPip
  • Advanced Member
  • 161 posts

Posted 22 September 2006 - 01:20 PM

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.


#3 JSHINER

JSHINER
  • Members
  • PipPipPip
  • Advanced Member
  • 465 posts
  • LocationBoston, MA

Posted 22 September 2006 - 01:23 PM

Thanks for the info... I'll give it a go.

#4 ronverdonk

ronverdonk
  • Members
  • PipPipPip
  • Advanced Member
  • 277 posts
  • LocationNetherlands

Posted 22 September 2006 - 02:24 PM

Have a look at the Ajax implementation of your request at Chained Select Boxes at http://www.dhtmlgood....html?page=ajax.
See also the demo at http://www.dhtmlgood...ned-select.html

Ronald  8)
RTFM is an almost extinct art form, it should be subsidized.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users