Skip to main content
Participant
September 28, 2022
Question

Adding Fields and multiplying by a fixed number

  • September 28, 2022
  • 1 reply
  • 199 views

I have a fillable form. The field I'm tryin to calculate is called Total Vac/Holiday Pay MC. I'm allowing the user to input the total Vacation Hours and the total Holiday Hours. I need for the Total Vac/Holiday Pay MC to calculate by adding the Vacation Hours and Holiday Hours together and multiplying by a fixed hourly rate. I've used this formula, but it is only calculating the Vacation Hours:

v1=getField("Holiday Hours MC").value;

v2=getField("Vacation Hours MC").value;

event.value=11*(v1+v2);....what am i doing wrong?

This topic has been closed for replies.

1 reply

JR Boulay
Community Expert
Community Expert
September 29, 2022

Try this:

 

v1 = Number(getField("Holiday Hours MC").value);

v2 = Number(getField("Vacation Hours MC").value);

event.value=11*(v1+v2);

Acrobate du PDF, InDesigner et Photoshopographe