Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Javascript Division Calculations

SigiPhoto
Level 1
Level 1

I have sucessfully added the values of 6 radio button groups in my form (using script below )and I now want to divide by 6 to get the average before the result shows in the field. Can someone tell me what to add to the script to do this? I'm a novice at Javascript and depend on this forum to help me out which I want to say thank you for. This forum has seen me through a lot of job tasks requested of me.

 

parseInt(Strategic.Strategic1.rawValue)

 

+ parseInt(BusKnowledge.Knowledge.rawValue)

 

+ parseInt(Compliance.Compliance1.rawValue)

 

+ parseInt(Decision.Decision1.rawValue)

+ parseInt(Demeanor.Demeanor1.rawValue)

 

+ parseInt(Relationships.Relationships1.rawValue);

1 Accepted Solution
radzmar
Correct answer by
Level 10
Level 10

Hi,

FormCalc comes with an average function you can use.

Just put this script in the calculate event of the field to display the average:

Avg(Strategic.Strategic1.rawValue, BusKnowledge.Knowledge.rawValue, Compliance.Compliance1.rawValue, Decision.Decision1.rawValue, Demeanor.Demeanor1.rawValue, Relationships.Relationships1.rawValue)

View solution in original post

2 Replies
radzmar
Correct answer by
Level 10
Level 10

Hi,

FormCalc comes with an average function you can use.

Just put this script in the calculate event of the field to display the average:

Avg(Strategic.Strategic1.rawValue, BusKnowledge.Knowledge.rawValue, Compliance.Compliance1.rawValue, Decision.Decision1.rawValue, Demeanor.Demeanor1.rawValue, Relationships.Relationships1.rawValue)

View solution in original post

SigiPhoto
Level 1
Level 1

This worked perfectly. Thank you so much. I've not used FormCalc before, but I'm going to go out and look for tutorial and learning opportunities today.

Again thank you so much for helping us novices out here get through some stressful situations.