2 Replies Latest reply on Feb 7, 2013 4:20 AM by SigiPhoto

    Javascript Division Calculations


      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(BusKnowledge.Knowledge.rawValue)


      + parseInt(Compliance.Compliance1.rawValue)


      + parseInt(Decision.Decision1.rawValue)



      + parseInt(Demeanor.Demeanor1.rawValue)


      + parseInt(Relationships.Relationships1.rawValue);

        • 1. Re: Javascript Division Calculations
          radzmar Adobe Community Professional & MVP



          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)
          • 2. Re: Javascript Division Calculations
            SigiPhoto 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.