There seems to be no way to set the label for a checkbox in code - https://www.wix.com/velo/reference/$w/checkbox
I’m using a single checkbox in a repeater, and need a different label for the checkbox in each item of the repeater. As a workaround, I’m using a checkbox with its label set to " " (setting it to “” isn’t possible), then using a text element alongside the textbox and setting the .text of that.
Anyone know why a label property (eg .text) for a checkbox isn’t exposed through the API?
Checkbox’s used to be 2 parts: the box and the text that acted as a label.
Now a checkbox comes with a native label you turn on and off, so it acts as 1 element instead of 2.
If I had to guess why the label cannot be modified via API is either because they forgot to code it OR they couldn’t figure it out. There are other places with little inconsistencies like this one …where one can do it but not another.
So … if you need distinct labels, add a text element next to the checkbox and code that instead.
What about using placeholder?
Thanks Nayeli - that’s what I’ve done. It’s actually better that way in my case as sometimes my text needs to wrap, which happens with a text element but I guess would not with a label.
I’ll also put up a suggestion to the Wix team (just in case they just forgot).