These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Radio Button Value Totals

eyedahoman
Registered: Dec 2 2010
Posts: 1

Hello Everyone. I have what I think is a simple question.
 
I have form with 10 radio buttons each having a label of yes and no. The values are 1 and 2 respectively. What I need to have happen is this. If the form user has selected all the yes radio buttons, I need some text to appear on the form with the words Ready to Order. If all the radio buttons are not selected to yes, then the words would be hidden.
  
Thanks in advance for your help.
 
Scott

My Product Information:
LiveCycle Designer, Windows
Niall
Expert
Registered: Apr 26 2006
Posts: 62
Hi Scott,

You can achieve this by summing the rawValue of the radio button exclusion groups. For example, if the radio button exclusion groups were called "question1", "question2",... "question10", then the following javascript in the calculate event of the subform containing the text you want to show/hide

var vScore = question1.rawValue + question2.rawValue; // you get the picture

if (vScore == 10)
{
this.presence = "visible";
}
else
{
this.presence = "hidden";
}


It would be slightly easier in FormCalc, where the ten radio button exclusion groups have the same name, "question[0]", "question[1]",... "question[9]".

var vScore = Sum(question[*])

if (vScore == 10) then
this.presence = "visible"
else
this.presence = "hidden"
endif


Hope this helps,

Niall
Assure Dynamics