- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 08:00 AM
Hi All,
Kindly provide solution for this.
I have two fields[Input Value is Numbers (a,b)] .On the third field[c] , I want the result of(a*b).
The problem I am facing is both [a,b] can be editable. If I write onchange Client script on A and if B value is edited. then c is populated with (a*b), where b is the old value but not the new value. Kindly help me in achieving this solution
Solved! Go to Solution.
- Labels:
-
Personal Developer Instance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 08:49 AM
Hey Mate,
While you can write onChange on both fields, but again if B value is edited first then it will still take old Value of A. So till value of A is changed you still see the result of new Value of B X old value of A in field C. --> Why would this happen?? It will take the new value if you use that each time.
Had these scripts been querying server or something heavy I might have suggested doing this on submit/save only. But these are light weight calculations and important form a user perspective, so you want to see the result of change without having to save/submit the records.
Here is the scripts, client side, for A and B and working perfectly
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 10:37 AM
this in on issue form , so I cannot work the logic with BR and 2 onchange client scripts is also not a solution. Is there any other way to achieve this

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 10:46 AM
Hello Pranika,
If you are sure that B value will be chnged only after value A then simply keep the onChange client script on B field.
var val = g_form.getValue("A");
var c = parseInt(newValue) * val;
g_form.getValue("c",c);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2020 01:05 AM
Hi,
Can you explain why the onchange client script is not an option? What scenario is it not covering?
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2022 10:59 PM