Is it possible to build coldfusion related selects...
# cfml-beginners
e
Is it possible to build coldfusion related selects using cfml only? I see some examples using javascript or ajax, but I don't know any of them.
d
what is that?
e
Not sure how else to ask this, but I am trying to build a page where user will pick a value in first select box and the second select box will be populated based on that value. I believe it's called "related selects"
d
ah ok. I don't know much about coldfusion UI stuff. I use kendo UI which is a javascript library. https://demos.telerik.com/kendo-ui/combobox/cascadingcombobox
m
honestly i would look into learning Ajax and JavaScript. Being able to change elements on the client side you really need to know the client side technologies. Ajax isn't ajax anymore you could call a page using JavaScript with fetch (really easy) and return back JSON to the JavaScript that then renders the additional select options.
👍🏾 1
👍 1
d
You need interactivity on the client side so you are going to need javascript regardless
a
I see some examples using javascript or ajax, but I don't know any of them.
You are a web developer in 2022. You need at least a working knowledge of this stuff. Saying you don't know this stuff is not an exit. It's an an acknowledgement of a gap in your (necessary) abilities to fulfil your role as a web dev. And you also need to think through what yer asking a bit. CFML runs on the CFML server. The select boxes you are talking about run on the browser. Two completely different locations. How would you envisage CFML playing a part in stuff that's running on the browser? To have functionality on the client side - the web browser - you need to use JS.
e
Thank Adam. I am not a web developer. I am a database developer, who is doing just a bit more frontend development to help internal customers. I agree about learning something new, especially if it's going to benefit me in the future, but ... if I knew it before, I would spend time learning JS and not CF. But, leaving all this all behind, my understanding is that it's not possible to do it using the functionality of CF tag language.
a
Well... a server side language. Same applies with PHP, Ruby, Python etc. You need to write the code for where it's gonna run, yeah?
So. To do what you need to do you need to extend yer web dev some more, and work through one of those examples you saw using JS etc.
g
The answer to this is Use cfselect with bind attribute and that will solve the issue you have You can find that example on adobe docs
e
Thanks gsr, I will take a look at it
c
@gsr you do realize that cfselect is using AJAX (JavaScript) to do that, right? However, cfselect is using really out-of-date JavaScript libraries to accomplish this, only partially supports what the underlying library could do, and use of the CF*** UI components is strongly discouraged by the community for this very reason?
1
💯 1
g
I know @cfvonner but as he mentions he is not a cf guy and wants to have the code working so this is the easiest option I can share instead of telling him to do all jquery stuff back and forth I agree cfselect is bad as it uses ext js