Copy link to clipboard
Copied
Hello,
I have a form that has four fields that need to calculate a percentage. I am not sure how to get that work. Can anybody help? There are two fields for 401k 1 and two fields for 401k 2 I have attached a screen grab of my form to help make sense of what I am trying to do.
Any help would be greatly appreciated.
Thanks.
Copy link to clipboard
Copied
Your post was moved over from the "Using the Community" forum, which is for getting help using this forum system, to a better forum.
I hope this helps. Best of luck to you.
In the future, So people don't have to download the image you have attached, please use the Insert Photos icon found in the Tool Bar of the Post and Reply text entry dialog window as pictured below.
Since you Can't Edit your original post to remove the Attached screen shot Please include the screen shot you attached to a new reply to this conversation by clicking the Blue Reply button under your original post and use the Insert Photos icon in the tool bar.
The Insert Photos icon is this one in the Tool Bar.
Thank you.
Copy link to clipboard
Copied
I have a form that has four fields that need to calculate a percentage. I am not sure how to get that work. Can anybody help? There are two fields for 401k 1 and two fields for 401k 2 I have attached a screen grab of my form to help make sense of what I am trying to do.
Any help would be greatly appreciated.
Thanks.
Copy link to clipboard
Copied
Some more details will help us help you... What are the names of the fields? What exact calculations do you want to do with them?
Copy link to clipboard
Copied
The most basic way of doing it is with the Simple Field Notation. Let's say you want Text2 to be 20% of Text1. You can use the following as the SFN forumla of the former:
Text1 * 0.2
For more advanced calculations, or more complex field names, a script might be needed.
Copy link to clipboard
Copied
The fields are named:
401k-1-Employee
401k-1-Employer
401k-2-Employee
401k-2-Employer
It seems that I would need a specific script (but not sure), here is what I think I want to have happen:
There are 13 fields that would be simple addition.
Then there are the percentage fields.
401k-1-Employee - contributes (unkown%) of (Salary, unknown) = a number that can be added to the total contributions.
Thanks!
Copy link to clipboard
Copied
I'm sorry, I don't follow the calculation you want to perform. Do you mean that you want to show the relative part of each field from the total?
Copy link to clipboard
Copied
I think the user is asking for a script to calculate a net amount taken from a gross salary or income (that is input in a separate field, not shown in the table) and then deduct a percentage from that amount only when the user enters a numeric value in the 401k-1 field, for example.
If I understood the question correctly this may be addressed with a custom keystroke script on each of the 401k-1 and 401k-2 fields.
For exaemple, in my script below I created a field named "Salary"and format the field as Number with 2 decimal places and currency symbol.
Then on the 401k-1-Employee field I used a custom keystroke script:
// CUSTOM KEYSTROKE SCRIPT 401k-1 Employee field
var v = event.value/100;
event.value = Number(util.printf("%.2f", (this.getField("Salary").value*v)/100));
Since the % deduction is unknown, using a custom kestroke script allows the user to type in whatever number value in the 401k-1 Employee field and it will display the total deduction in a Number format when the user hits enter or clicks outside of that field with the mouse pointer after the value is typed in.
This will allow to totalize that field as a Number value (not a string value) with the rest of the Annual/Monhtly Contributions listed in that table.
donnaj is this what you're inquiring about?
Copy link to clipboard
Copied
Yes, I think this is what I am asking. I will input your script and test it.
Thank you so much for your time. I will circle back to this conversation later.
Copy link to clipboard
Copied
Thank you all for your help. This script did not perform the function desired. My end user has decided not to pursue solving this problem. I appreciate all your efforts.
Copy link to clipboard
Copied
You're welcome.