Add the following to the dropdown block:
Command: attribute
Value: onchange="hideBlock(this,'Name')";
Where ‘Name’ is the block name to hide
Add the following JS code to the Main Template
<script>
function hideBlock(obj,bname)
{
var col = $(obj).val();
var b = $("input[data-blockname='" + bname + "']");
if (col=="Blue") {
// Hide
b.val("");
b.parent().hide();
b.parent().siblings().hide();
}
else
{
// Show
b.parent().show();
b.parent().siblings().show();
}
}
// Runs when Page Loads
function _initLoad()
{
hideBlock($("select[data-blockname=Colour]"),"Name");
}
</script>
Where ‘Blue’ is the value when selected, block ‘Name’ will hide. The extra lines are there to hide the label as well.
Colour is the name of the Block to hide.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article