button click to show field only if text field is populated
I understand how to show and hide fields with a button click. But, what I'm trying to do is, click a button and to show a field only if that field has a calculation from other fields. If no info is calculated from the other fields, then the field in question would remain hidden no matter how many times I click the button. But then, the fields that have been populated would show leaving the un-populated fields hidden. Can this be done? Here's a couple of scripts I've been playing around with but I can't get to where I want to go using them.
Script:
this.getField("Item.1").display = display.hidden;
and/or,
if (this.getField("Item.1").valueAsString=="") event.target.display = display.hidden;
else event.target.display = display.visible;
Would someone teach me the correct script to do this and to help me out? Thanks.
