I am making an evaluation form with Adobe Acrobat 9.0. I have 14 criteria CP1a, C1b, Cp2a, Cp2b through CP7b. I also have 5 performance levels: Exemplary, Consistently Effective, Effective, Conditional, Unsatisfactory. Each of the 14 criteria have a point value based on what performance level they are ranked at. So each line as a total value: "CP1atotal" "CP2btotal" ect. I have written a script so if the evaluation total is between 90 and 100 it says "Exemplary" 80-90 it says "Consistently effective", etc. So far so good.
But now we decided if any one of the 14 criteria is a "Unsatisfactory" then the whole thing should be unsatsifactory regardless of the total score. So I need a script that syas if any of the 14 criteria totals equal zero then "unsatisfactory". I got it work with one variable with this script
var CP1atotal = this.getField("CP1atotal").value;
if (CP1atotal < 0.05) event.value = "Unsatisfactory";
else event.value = "";
but once you add a second variable it stops working.( Note CP1atotal = 0 did not work so I assumed that had something to do with it seeing 0 as null so I went with less than .05 and it worked). I think I should be able to use some sort of switch script to include all 14 variables but I don't know how. Any help would be apprecitated.
You need to first explicitly convert the value to a number, like so:
var CP1atotal = Number(this.getField("CP1atotal").value);