Keep disappearing text with a formulated field
Hi everyone,
I have a textbox with disappearing text and want to calculate the absolute value of another textbox. I added a custom calculation script in Properties > Calculate, but it overrides the disappearing text and shows "0" when there's nothing to calculate. I tried doing a nested if statement in the Calculate and Format sections, but I get NaN (which makes sense). I included the scripts I used for each thing; the disappearing text script worked before I added the absolute value calculation.
Is there a way to have a textbox display disappearing text when the calculated value is "0"?
Thanks!
//Absolute Value Calculation in Properties > Calculate
event.value = Math.abs(Number(this.getField("($) Gross Up").valueAsString));
//Disappearing Text script in Properties > Format > Custom Format Script
if (!event.value) {
event.value = "$ Gross Up" ;
event.target.display = display.noPrint;
else {
event.target.textColor = color.black;
event.target.display = display.visible;
}
//My attempt at the nested if statement
var A = this.getField("($) Gross Up").value
if (A = 0){
if (!event.value) {
event.value = "$ Gross Up" ;
event.target.display = display.noPrint;
}else {
event.target.textColor = color.black;
event.target.display = display.visible;
}
}else{
event.value = Math.abs(Number(A.valueAsString));
}
