Persits Software, Inc. Knowledge Base Articles

Radio buttons on PDF forms do not show up on iOS

Problem Description

After filling an interactive PDF form with AspPDF's SetFieldValue and SetFieldValueEx methods, radio button fields appear blank when the form is viewed on iOS devices such as iPads and iPhones. The same form is displayed properly on Windows and Android.

Solution

To select a radio button by the name of "RadioField", two lines of codes are normally needed: a call to FindField followed by a call to SetFieldValueEx on one of the radio button's child fields. This is sufficient when the form is viewed on Windows or Android. However, for the radio button fields to be viewed properly on iOS as well, another line of code is needed, a call to SetFieldValueEx on the parent radio field itself, as shown below in blue:

idx = 1 ' 1-based index of the radio button to select
Set field = Doc.Form.FindField("RadioField")
field.Children(idx).SetFieldValueEx _
   field.Children(idx).FieldOnValue

field.SetFieldValueEx field.Children(idx).FieldOnValue