I have a "special title" field in my database that shows up as a button on my repeater:
I want the button to be completely hidden when the field is empty.
I tried using code from this comment: https://www.wix.com/velo/forum/main/comment/5ea5f5e837a99b0051c1e278r
But this only hides the text and not the green bubble.
How can I fully hide the button?
Hi there 👋🏻 I do something similar on my site. This is the code I use, hopefully it can help you out. Just change the element IDs to match yours. (i.e. "#button3" would replace "#yourElement", and the same for your dataset ID and repeater ID)
Good luck!
$w.onReady(function () { $w('#yourDataset').onReady(() => { $w("#yourRepeater").onItemReady(($item, itemData) => { let sTitle = itemData.specialTitle; if (sTitle === "" || sTitle === null || sTitle === undefined) { $item("#yourElement").hide(); } else { $item("#yourElement").show(); } }); }); })
You have to find the green bubble element and apply .hide() method if specialTitle is empty.
if (specialTitle === "") { $w("#greenBubble").hide() }