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?
Views
Replies
Total Likes
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
I'm not showing any errors.
Views
Replies
Total Likes
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.
Views
Replies
Total Likes