Adobe Pro: pdf form - simple if/else not working (empty field)
Dear all:-)
I never thought it could be so complicated to put an simple If/else statement in a pdf form 😉
Initial situation:
- There are 3 columns in a table: target, actual and delta.
- All associated fields are formatted as "numbers".
- The user enters amounts in the target and actual fields, the delta is calculated automatically.
Task:
- Adding a column 4 called "Delta> 3%"
- Whenever the (calculated) delta is> 3% of the target value, a "x" should be written in the column, otherwise do nothing (or rather overwrite an existing "x").
My considerations:
Var A = this.getField("delta1").value;
Var B = this.getField("Target1").value;
Var C = this.getField("delta1").value / this.getField("Target1").value;
If (C > 0.05) { this.getField("deltabigger5").value = "×";}
else {this.getField("deltabigger5").value = "";}
Unfortunately, when I enter that, nothing happens. The field remains empty, regardless of which values I enter in delta1 or Soll1.
I also don't get any error messages (syntax). Can someone help me and tell me why? Where is the mistake?
