0

I am making a fillable pdf for a questionnaire in pdf. I have to use radio buttons in the questionnaire. I used the below code snippet to get the value of the radio button group, but it gives me either a null exception or return blank.

I tried a simple code in a blank pdf with just one group of radio buttons with two options and a button.

enter image description here

The code is shown below, where "Group1" refers to the radiobutton group:

var choiceVAL = this.getField("Group1").value; app.alert(choiceVAL);

On clicking the button, the code keeps giving me an exception. I checked all the forums, and this is the code snippet that is used everywhere. I have set the export value to "Y" and "N" respectively.

Can anyone help me with this??

Nimy Alex
  • 155
  • 1
  • 3
  • 13
  • 1
    That code should work... it certainly works for me. What is the exception you're seeing in the console? – joelgeraci Sep 06 '19 at 19:10
  • The error that I get is this : "getField("Group1").value is null" – Nimy Alex Sep 06 '19 at 21:42
  • Values of PDF fields are never null. The value is either the default value, an empty string, or "Off" in the case of radio buttons where none in the group are selected. Are you sure the field name is "Group1"? – joelgeraci Sep 06 '19 at 22:19

0 Answers0