Skip to main content
Known Participant
March 21, 2023
Question

Percentage of Weekly Salary

  • March 21, 2023
  • 4 replies
  • 1393 views

All, I have an annual salary field on a form that I have another field that needs to compute the weekly salary by 60%.

 

This is what I have an it isn't working.  What am I missing?

 

var EESal=getField("AnnualSalary").value;

var Percent=.60;

Var WklySal=EESal/52;

event.value=WklySal*Percent;

This topic has been closed for replies.

4 replies

Participant
June 3, 2024

It seems there's a minor typo in your code. For the calculation of the weekly salary in UIF, change "Var" to "var." Also, ensure that the field names in your form match exactly.

Participant
June 3, 2024

It looks like there's a small typo in your code. UIF calculates salary: Change Var to var for the WklySal calculation. Also, ensure the field names match your form exactly.

try67
Community Expert
Community Expert
March 21, 2023

Here it is working fine (after fixing the error in the code pointed out by Nesa)...

Nesa Nurani
Community Expert
Community Expert
March 21, 2023

Change Var in 'WklySal' to lowercase.

Known Participant
March 21, 2023

Thank you, did that and still not calculating but at least it recognizes it as a formula now.

Nesa Nurani
Community Expert
Community Expert
March 21, 2023

Where did you put script?