• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Percentage of Weekly Salary

Community Beginner ,
Mar 21, 2023 Mar 21, 2023

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;

TOPICS
JavaScript

Views

772

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Change Var in 'WklySal' to lowercase.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Where did you put script? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

In the custom calculation script of the calculate tab of the field I want to show the 60% calculation, 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Do you get any error in console? 

Can you post file? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 21, 2023 Mar 21, 2023

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Try creating a new file with just those fields included in calculation and post that.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 22, 2023 Mar 22, 2023

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 03, 2024 Jun 03, 2024

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 03, 2024 Jun 03, 2024

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines