简体   繁体   中英

Adobe Acrobat Calculation

This is probably really simple, but I'm struggling.

I have fields t2, t5, and total.0.

If t2 is null or zero, I want total.0 to not show with anything (blank).

If t2 does have a number in, then t2-t5 with the total going into total.0.

Put the following code into the custom calculation script for "total.0". Be sure it's not formatted to be a number or you'll get a zero as the appearance. Note: Empty fields in PDF are never null, they're empty strings.

if (this.getField("t2").value == "" || this.getField("t2").value == 0)  {
    event.value = ""
}
else {
    event.value = this.getField("t2").value - this.getField("t5").value
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM