Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion combo box multiple fields

Status
Not open for further replies.

PaulTurk

Programmer
May 2, 2003
7
GB
Can someone please help me with this proble. I'm unsure of how to populate a combo box with 2 fields such as country and regions within that country and allow the user to select either a country or a region. This will then display records for the particular country or region.

If this method is not possible i would also consider having two drop down boxes, one for country and the other for region. Once the user selects a country the region combo box will be populated with the regions for that country.

Is there any way of doing this??

Thanks
 
You have a number of options:

1. a single drop down listed like this:

England:London
England:SouthWest
Scotland:Glasgow
Scotland:Edinburgh

2. Or you can use javascript. What you'll need to do is using the select box's onchange event have a function which populates the second drop down box based on the selection in the first.You can use coldfusion server side to populate the values for a javascript array.
There is a custom tag on the Macromedia site somewhere# called 2 selectsRelated that will do the above. If you cant find it there try google.

3. When the first drop down changes submit the form and refresh the page with new values for the second drop down.

Unfortunately the last 2q options of the above require javascript. Which may not be a problem provided you know all your visitors will definetly have javascript enabled.

Hope that helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top