Dynamic CSS toggle class when checked checkbox

Hi,

I have created a dynamic checkbox and applies Dynamic attribute of Class Toggle, the condition is to toggle the class when the Checkbox is checked, which creates a border around the Card box.
I have a custom css class in the style.css file.

I can’t seem to get it to work. Any assistance would be appreciated.

Hi @famousmag not sure what you are referring to. But this was created using the dynamic picker and I selected the checked state of the checkbox.
Am I to rename something. Just need further clarification please.
Thanks

set your input static id to “checkbox” (this has nothing to do with the dynamic id).
<input id=“checkbox”…>

And then use the dynamic picker to bind the class toggle
(dmx-class:box-checked=“checkbox.checked”)

or whatever static id you want…

thanks very much @famousmag, thats worked! I am not sure why though. I have multiple checkboxes that are dynamically created, so I thought creating a static id would highlight all of them at once when one is clicked, but it doesn’t.

1 Like