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

Numeric field value based on radio button

Uashbjo
Registered: Mar 3 2009
Posts: 18
Answered

Hi,

Maybe the subject has been discussed before but I didn't find it. Here's my question:

How do I change the value of a numeric field when a radio button is selected?

Exemple:
I have a yes/no radio button. If the Yes is selected than my numeric field value is 5. If the No is selected than the value is 0.

Thank you!

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The value of a radio button is given by it's export value. Take a look on the "Binding" tab of "Object" data for the radio button group. At the bottom of this tab you can change the export value for a particular button. Then, on the "MouseUp" event for the radion button, add this code

MyTextField.rawValue = this.rawValue;

Hope that helps,
Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Uashbjo
Registered: Mar 3 2009
Posts: 18
Hi

Thank you for your help. But I think I didn't describe my problem in a good way.

I created a form with a series of yes/no questions so that my coworker can fill it up faster than before. The last page is a resume of all the questions but with points awarded for each questions depending on whether he answered yes or no. For now, he has to answer all the questions and then he awards the points at the end.

What I'd like to do is eliminate the part where he awards point at the end. I'd like to do it automatically when he answers the questions. In the end, everytime he answered yes, 5 points are awarded on the last page, if he ansered no, no points are awarded. In the end, when he answered all the questions, the resume of all the points is already done.

My problem is that I can't find a way to do that with radio buttons.

Your help is greatly appreciated!

Jonathan Ashby
Jimmy0306
Registered: Dec 11 2008
Posts: 32
Is this what you are trying to accomplish?
http://fi9dla.bay.livefilestore.com/y1p32VAcvQ4n5CZ8crX__L9r-9UlILcNCM9C_etqgqCLbdwFldrrPnJmZGgo0Bjl4xggUbc2Rb_ZNQ/Sample%20Survey.pdf?download
henrie14
Registered: Mar 12 2009
Posts: 1
I have multiple choice questions where I want the person filling out the form to be able to select one choice and one choice only, so i did the radio button option for each question on my form, but is there a way to actually assign numerical values to each of the multiple choice options where they can then be summed up to give me a total at the end.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
There is an option to assign a numeric export value in both AcroForms and LiveCycle Designer. Live Cycle Designer also has a numeric value for exclusionary groups of radio buttons when no item is selected but AcroFroms assigns the value of "Off".

You should be able to use the forums search for "sum radio" and find a number of posts about this topic.

George Kaiser

Uashbjo
Registered: Mar 3 2009
Posts: 18
Thank you very much for your help. I finally found it and so simple:

Javascript
Calculate
this.rawValue = TopmostSubform.Page4.Groupe_de_boutons_radio_1_6_2.rawValue

Thank you again for your support even though I wasn't very clear about what I wanted.