HTML Snippet code placed in DesktopLayout

0
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!
asked
3 answers
2

Hi!

Try the JavaScript Snippet https://appstore.home.mendix.com/link/app/43096 instead

 

Edit: oh okay, you found it already ;)

answered
0

You know for sure this is the right id? And this id is always the same? 

answered
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.

Thanks!

answered