Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
Change Var in 'WklySal' to lowercase.
Copy link to clipboard
Copied
Thank you, did that and still not calculating but at least it recognizes it as a formula now.
Copy link to clipboard
Copied
Where did you put script?
Copy link to clipboard
Copied
In the custom calculation script of the calculate tab of the field I want to show the 60% calculation,
Copy link to clipboard
Copied
Do you get any error in console?
Can you post file?
Copy link to clipboard
Copied
No, no error and I can't post the entire file, but gave you the script I used above and corrected the var. It has HIPPA information on it, sorry.
Copy link to clipboard
Copied
Try creating a new file with just those fields included in calculation and post that.
Copy link to clipboard
Copied
Thank you, I figured out my mistake this morning. There was a semi colon at the end of the event statement and it shouldn't have been. Once removed, the statement worked perfect.
Thank you Everyone!
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.