Hide content on a checkbox

edited March 2014 in Enyo 2
I haven't tested this with all controls, but suspect it might behave the same way....

Here's a fiddle: http://jsfiddle.net/pcimino/MLg8d/

The button toggles the showing property on the checkbox to alternately hide/show it. I assigned the content of the checkbox kind as a label, but it doesn't hide when the checkbox does. Is there a way to accomplish this? Or do I have to put the checkbox and a separate content label in a group and then hide the entire group?


  • There isn't a way. If you look at the generated HTML, you'll notice that the content isn't inside the input tag (it can't be to be valid markup). Hiding the input couldn't hide the text since it's its sibling rather than its child. I'd suggest wrapping it with an InputDecorator and toggling the display of that.
  • Thanks. That was simple enough.
Sign In or Register to comment.