August 6, 2021
On a form, second select options will depend on the first selection from a drop down.
Comments
(2)
August 6, 2021
On a form, second select options will depend on the first selection from a drop down.
Newbie 1 posts
Followers: 0 people
(2)

On a form.  When someone selects on option from a select dropdown, I want the other drop down to change and only show some of the options based on the first dropdown selection.

2 Comments
2021-08-19 02:16:55
2021-08-19 02:16:55

Paul, how did things turn out for you?

Like
2021-08-12 16:18:11
2021-08-12 16:18:11

This has in the past been referred to as “two selects related”, and there have been CF-oriented resources (articles, blog posts) written over the years using various techniques, such as based on Ajax or not (including whether using CF-specific ajax features, or not).

Here are a few you can consider. I have not reviewed them to confirm they all work currently (but you don’t say what version of CF you use). And note that sometimes they may complain about a problem that was true then but is fixed since, such as easily creating json from a query, which is now an option on cfquery itself (or queryexecute), as of CF2021:

https://yiengly.wordpress.com/2017/08/15/populating-a-related-select-using-jquery-in-coldfusion/

https://www.raymondcamden.com/2014/05/30/Related-selects-with-multiple-options

https://stackoverflow.com/questions/49124480/how-to-created-related-select-lists

https://stackoverflow.com/questions/16700545/populating-a-second-dropdown-using-coldfusion-jquery-and-ajax

and a blast from the past (2007):

https://forta.com/2007/05/31/coldfusion-ajax-tutorial-2-related-selects/

Even the CF Docs have coverage of approached that could work, but the presentation is rather obtuse and buried within/surrounded by other topics even on each of the following single pages:

https://helpx.adobe.com/coldfusion/developing-applications/requesting-and-presenting-information/using-ajax-user-interface-components-and-features/using-ajax-form-controls-and-features.html

https://helpx.adobe.com/coldfusion/developing-applications/requesting-and-presenting-information/using-ajax-data-and-development-features/binding-data-to-form-fields.html

Those are a few to hopefully get you going. Please let us know if any works out well for you (or not).

Like
Add Comment