You are viewing limited content. For full access, please sign in.

Question

Question

Calculate sum if a field is present

asked on December 3, 2015 Show version history

I am trying to calculate the sum of two numbers. The problem I'm running into is that I don't know which number will be present. The user selects an Infraction type, and based on the infraction, a specific number is shown "Points Added for this Infraction". I have a field rule to only show the user the number of points that will be added based on their selection. In the "Points Prior to Infraction" field I have that number being pulled from a SQL server based on the employee's ID number. How do I add the "Points Prior to Infraction" to another field based on their selection for the infraction, and have it show up in "Points After Infraction"?

Thanks!

0 0

Answer

SELECTED ANSWER
replied on December 4, 2015

You can try to use the sample code in forms help site, see here ;

and instead of using

$('.sum input').each(function () {

with 

$('.sum input').filter(':visible').each(function () {

in the code;

also can see this case http://answers.laserfiche.com/questions/47631/How-do-I-perform-calculations-on-fields-in-Forms

Hope it can work.

 

 

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.