Hide html component using JS

I am trying to hide a html component based on the value of a field. I found this on the forum (I added the timeout, whihc may be the problem) but it won’t hide the component, What am i doing wrong please.

TB.render(‘component_104’, function (data) {
setTimeout(function() {
fieldValue = data.record.field_1473;
if(fieldValue === “Pipeline”){
TB.hideComponent(‘component_65’);
}, 1000);
});
});

Here is one that will work. Just update your component #'s

TB.render(‘component_76’, function(data) {
fieldValue = data.record.field_1080;
if(fieldValue === “”){
TB.hideComponent(‘component_134’);
}

   });

This could work as well:

TB.render(‘component_104’, function(data) {
setTimeout(function() {
var fieldValue = data.record.field_1473;
if (fieldValue === “Pipeline”) {
TB.hideComponent(‘component_65’);
}
}, 1000);
});

ChatGPT is a great help on troubleshooting JS. Not a perfect solution but certainly helps.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.