- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 01:22 PM
Hi All,
I have a scenario where I need to add the values of 3 fields and put the sum on a different field. For example:
Field 1= 12
Field 2 = 13
Field 3 =14
Add 12+13+14 and put the total on Field 4
How would I accomplish this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 02:01 PM - edited 08-19-2024 02:03 PM
You can use onchange or onsubmit client script based on your requirements and the script would be like below:
var field1 = g_form.getValue('u_field_1');
var field2 = g_form.getValue('u_field_2');
var sum = parseInt(field1) + parseInt(field2);
g_form.setValue('u_field_3', sum);
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 01:51 PM
Where do you have these fields?
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 02:01 PM - edited 08-19-2024 02:03 PM
You can use onchange or onsubmit client script based on your requirements and the script would be like below:
var field1 = g_form.getValue('u_field_1');
var field2 = g_form.getValue('u_field_2');
var sum = parseInt(field1) + parseInt(field2);
g_form.setValue('u_field_3', sum);
If my response helped you, please click on "Accept as solution" and mark it as helpful.
- Saloni
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 02:20 PM
Hi Saloni,
I'm being asked for a field name for "onChange" however I have more than one field. I can only select one field, I can't use "onSubmit" I need onChange,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-19-2024 01:52 PM
Hi Saloni,
These fields are located on a custom app form.