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

use of allowNeutral for radio buttons

crisis_davis
Registered: Apr 14 2008
Posts: 3
Answered

According the reference guide allowNeutral specifies whether the check box or radio button can support an additional third state that represents a
neutral value.

I have tried to set this value using javascript and edited the xdp directly to set it, however no luck.

What we are trying to achieve is to allow a user to deselect a radio button set once they have selected an option.

Has anybody successfully used this feature?

My Product Information:
LiveCycle Designer, Windows
twhayes
Registered: Sep 25 2007
Posts: 20
Hello,

Yes, you can do this. I just created a test form and it works fine.

Create a new test form. Add a radio button. Set it's name to "rbTest". Copy and paste this button to create "rbTest[1]". Rename the radio button container group to rTest. Create a button labelled "Get Value". Create another button labelled "Reset Selection". Create a text label, named "tTest".

You now have, in the Hierarchy pane:
Form
-rTest
--rbTest[0]
--rbTest[1]
-Button1 "Get Value"
-Button2 "Reset Selection"
-tTest "Text"

Add some code:

Button1::click gets:
tTest.rawValue = Str(rTest.rawValue)

Button2::click gets:
rTest.rawValue = 0

Save your form and then click the "Preview PDF" tab and play with selecting and reseting your radio buttons.

Enjoy!
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi crisis_davis,

In addition, you may want to check out the "Creating Radio CheckBoxes" article at JavaScript Corner ( both a LCD and AcroForm PDF with code available for download)-

http://www.acrobatusers.com/tutorials/2007/js_radio_check_box/

Hope this helps,

Dimitri
WindJack Solutions
www.windjack.com
juliel
Registered: Dec 30 2009
Posts: 15
Has anyone figured out yet how to deselect a radio button on a form in Acrobat 9.0?
Please do not suggest using check boxes instead of radion buttons. There has to be a way to unclick a button that has been clicked on either by setting something in the properties dialogue box or by running a java script. I've been searching for days and have tested various scripts and have not found one that works.

Please help me.

Thanks!
pforms
Registered: Nov 17 2009
Posts: 87
I've used a three button approach - not pretty but it works

3 buttons: YES - NO - CLEAR.

Script is on the CLEAR button.

In design mode, click on the CLEAR button and in the scripting

window enter: xfa.host.resetData("RadioButtonGroup Name");.



Use Java Script and select "click" from Event drop down
jonom
Registered: Jan 31 2008
Posts: 133
juliel wrote:
Please do not suggest using check boxes instead of radion buttons.
Well, you may not want to hear it, but it's easier to make check boxes work like radio buttons. Why do things the hard way?
alfette
Registered: Jun 29 2010
Posts: 13
Dimitri wrote:
Hi crisis_davis,In addition, you may want to check out the "Creating Radio CheckBoxes" article at JavaScript Corner ( both a LCD and AcroForm PDF with code available for download)-

http://www.acrobatusers.com/tutorials/2007/js_radio_check_box/
Hi, this article moved... But I found it here:
http://www.acrobatusers.com/tutorials/creating-radio-checkboxes