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

Rating Radio Buttons

Avatar

Level 4

I'm trying to take the value I've assigned to a radio button, add it to another value I set for another set of radio buttons, divide the total by the number of radio buttons actually selected to get an average for the group. Here's what I have, but it's not displaying any information.

This is on the click event of a button:

var

count = 0;

var

addvalues = 0;

if

{

   count

(SectionAA1.rawValue != null || SectionAA1.rawValue != 0)= count++;= addvalues + SectionAA1.rawValue;

   addvalues

}

if

{

   count

(SectionAA2.rawValue != null || SectionAA2.rawValue != 0)= count++;= addvalues + SectionAA2.rawValue;

   addvalues

}

if

{

   count

(SectionAA3.rawValue != null || SectionAA3.rawValue != 0)= count++;= addvalues + SectionAA1.rawValue;= addvalues / count;

   addvalues

}

SectionAValue.rawValue

What am I missing?

3 Replies

Avatar

Level 10

In Acrobat hit he Ctrl-J key combination and the javascript console will come up (any errors in your script will be reported there).

Paul

Avatar

Level 4

I got it figured out. I was using the ++ after i.  I should have just did i + 1.  Plus I have to convert the rawValues to numbers if I want to add them together.