Hi All, I am trying to hide or show a ‘Custom String’ placed in DesktopLayout. I am using an HTML Snippet and putting a JS using jquery in that, but it’s not working. Can someone suggest how to get that worked? Here is the snippet code, $(document).ready(function(){ if($('#CustomString_widget_CustomStringNoContext_1').text() == ""){ $('#CustomString_widget_CustomStringNoContext_1').hide() } else{ $('#CustomString_widget_CustomStringNoContext_1').show() } }); Please, suggest if this needs to be changed. Note: it’s a second Custom String, hence the id is ‘CustomString_widget_CustomStringNoContext_1’. Thanks!
You know for sure this is the right id? And this id is always the same?
answered
Sander Suijkerbuijk
0
Hi All,
Mentioned snippet code is correct, but it was not working inside HTML Snippet (not sure why). Instead, I used 'JavaScript Snippet' (https://appstore.home.mendix.com/link/app/43096/) and the same code worked.