Reading values of Radio / Check button fields

49 views
Skip to first unread message

Support

unread,
Jan 22, 2013, 10:08:07 PM1/22/13
to pdfne...@googlegroups.com

Q: In our Acroform we defined a Radio Group Name called ‘SubTitle’ which has five physical buttons representing someone’s title like ‘Mr’,’Mrs’,’Miss’,’Ms’ or ‘Dr’. In the properites of each physical radio button the values are defined as ‘Mr’, ‘Mrs’, ‘Miss’,’Ms’ or ‘Dr’.

 

So when we try to retrieve the radio button selected we have the following code

 

f = doc.getField("SubTitle");                          // Values should be Mr,Mrs,Miss,Ms,Dr

if (f != null) sub_title = f.getValueAsString();

 

The Issue: what we are finding is that sometimes we are getting either an empty string, the value expected or a number like 0 or 3 returned
 
 ---------------
 
A: Since you are dealing with check/radio fields you should use GetValueAsBool() instead of GetValueAsString().

Reply all
Reply to author
Forward
0 new messages