Copy link to clipboard
Copied
Hello I am trying to update a document with a Javascript in which, you can calculate the following:
Box 1) "Total score out of 60" give a value of 50% of "final score"
Box 2) "total score out of 15" give a value of 50% of "final score"
Final score = Box 1+ Box 2 - I can do the simple additions ... don't need help here.
Copy link to clipboard
Copied
Enter the following custom calculation script in the result field:
event.value = this.getField("Box1").value/60 * 37.5 + this.getField("Box2").value/15 * 37.5;
Change Box1 and Box2 to the actual field names.
Copy link to clipboard
Copied
it didn't work.
"Total_Comp" is score out of 60
"Total_Goals" is a score out of 15
I need 2 scripts ("fifty_comp" & "fifty_goals") to calculate each value as a score out 50
then I will add other box to combine sum of "fifty_comp" & "fifty_goals". - no need for help on this one.
Copy link to clipboard
Copied
Change both 37.5's to 50, and split the script into 2 parts where the + sign is. I don't know the names of your fields. The first script would be:
event.value = this.getField("Box1").value/60 * 50;
the 2nd script would be
event.value = this.getField("Box2").value/15 * 50;