Copy link to clipboard
Copied
I have 7 txt fields. Like so, ST1, ST2, ST3...ST7. With 1 TotalST field for all the "ST" fields (which calculates the totals the fields). What I would like to do is, when the ST fields are not populated then the TotalST field would be hidden. When one or all the ST fields are populated the TotalST field would be visible, but also calculates the ST fields. Then the TotalSt would hide if I delete the input from all the ST fields.
At the moment I have the calculation working fine (pretty simple) using the Simplified window. But, I think, this needs a javascript that would have to be placed in the Custom Calculation window. So, can someone provide a script that would do what I'm hoping to do? Thanks.
Sure. Use this code instead of the one above:
event.target.display = (event.value==0) ? display.hidden : display.visible;
Copy link to clipboard
Copied
You want to actually hide the field, or just not show the "0" value?
If the latter then simply enter this code as its custom validation script:
if (event.value==0) event.value = "";
Copy link to clipboard
Copied
How would I show/hide the fields? Your script works to not show the "0". But, I'd like to show the field when the ST fields are populated, when not, then to hide the TotalST field. Can that be done?
Copy link to clipboard
Copied
Sure. Use this code instead of the one above:
event.target.display = (event.value==0) ? display.hidden : display.visible;
Copy link to clipboard
Copied
Works great!! Thank you
Find more inspiration, events, and resources on the new Adobe Community
Explore Now