CFINPUT BIND to JQUERY? I am working to move an o...
# cfml-general
d
CFINPUT BIND to JQUERY? I am working to move an old school Adobe ColdFusion app to Lucee with FW/1. I have a page that has multiple like buttons on it that each bind to a CFC using <cfinput bind=.... I know that's outdated and not recommended. Also, it doesn't work in Lucee. I believe the best way to do this is using jQuery (which I haven't learned yet). How would I replace this with jQuery? cfinput( name = "Toggle_Like_#ARGUMENTS.Like_Type_ID#_#ARGUMENTS.Like_Foreign_Key_ID#", id = "Toggle_Like_#ARGUMENTS.Like_Type_ID#_#ARGUMENTS.Like_Foreign_Key_ID#", type = "checkbox", checked = "#Int(Val(qrs_Like_Details.User_Likes_This))#", bind = "cfc:model.services.userinterface.fn_Toggle_Like( #function_Account_ID#, #ARGUMENTS.Like_Type_ID#, #ARGUMENTS.Like_Foreign_Key_ID#, {Toggle_Like_#ARGUMENTS.Like_Type_ID#_#ARGUMENTS.Like_Foreign_Key_ID#@click} )", bindonload = "true" );
a
I'd perhaps not approach this from the "how do I replicate this code using client-side technology", I'd approach it "how do I implement the feature using ~" In your position, I'd dispense with the immediate requirement for now, and do some tutorials on how to do bind remote calls to form controls. Learn how to do it, then use that knowledge to reimplement the form control.
d
Got it. What direction should I go in? I'm not sure where to start with this problem. Is learning jQuery the place to start? Or is there another modern technology I should learn in order to implement this instead?
s
If you aren't committed to jQuery right now you will be better served with something newer - straight-up Javascript is awesome in a way it didn't used to be and jQuery is less 'necessary' but there's also React or VueJS (not entirely analagous to jQuery but they're 'the big things behind a lot of web development'). jQuery was great for a long time but there's not a good reason to start fresh with it if you don't have to in 2023
💯 5
d
Got it, thanks. I will tackle learning Javascript. In the short term, however, I need an immediate solution for this Like button / toggle binding issue for a project due in a few weeks. Is there an expert here I could hire to help me with this?
p
Another really great option that I’ve taken to, and so has @Mark Takata (Adobe) is HTMX (htmx.org). Super easy and works well within a framework like FW/1 or ColdBox. Also easy to understand without having to go all in with React or Vue.
❤️ 1
m
I definitely love HTMX. ES6 (vanilla modern JS) is a great choice, as is AlpineJS (which some folks refer to as "the modern JQuery" for its simplicity)
❤️ 1