Print Page | Close Window

Setting RadioButton values

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3917
Printed Date: 04 May 24 at 11:27PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Setting RadioButton values
Posted By: chris_adsi
Subject: Setting RadioButton values
Date Posted: 19 May 21 at 12:10PM
We have a PDF with form fields from one of our suppliers that we need to fill in, and some of those fields are radio buttons. Checkboxes seem fine, but RadioButtons we are struggling with.

They have a few groups for title (Mr,Mrs etc) and I can't get them ticks to show, even though my code returns a success for the SetFormFieldValue call.

Searching it seems I need to set the value of the field to the name of the appropriate SubName which I have tried, and which returns a 1 for SetFormFieldValue, but the boxes are never ticked on the resulting output document.

This is my code (VBA) - varValue is set to the same value as I get back from one of the GetFormFieldSubName calls so I am for instance setting the value to "2" to try and select one of the options :

                        'fill in a form field
                        Case RenderType.FormField
                            Select Case fld.FieldType
                                Case FieldType.CheckBox, FieldType.Radiobutton
                                    intSubCount = objPDF.GetFormFieldSubCount(lngField)
                                    For intSub = 1 To intSubCount
                                        strSubName = objPDF.GetFormFieldSubName(lngField, intSub)
                                        If strSubName <> "Off" Then
                                            lngSub = objPDF.GetFormFieldKidTempIndex(lngField, intSub)
                                            If strSubName = varValue Then
                                                lngRes = objPDF.SetFormFieldValue(lngField, strSubName)
                                            End If
                                        End If
                                    Next
                                Case Else
                                    lngRes = objPDF.SetFormFieldValue(lngField, varValue)
                            End Select

Many Thanks



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk