mutual exclusive checkboxes (or radiobutton)

20 views
Skip to first unread message

Conte Andrea

unread,
Sep 6, 2017, 11:30:30 AM9/6/17
to PDFTron PDFNet SDK
Hello,
i've a PDF containing various types of acrofields (e_text, e_signature, etc)

There are also 10 checkboxes (e_check) grouped in two groups of five.
These checkboxes are mutual exclusive, they have same name "c1, c1, c1, c1, c1, c2, c2, c2, c2, c2) but different exportation value (0, 1, 2, 3, 4, 0, 1, 2, 3, 4).
When a user tap with finger (i'm using PDFNet.Xamarin) on top of one checkbox it works like expected: others checkbox of same group was unchecked.

The question is: how i get selected checkbox value inside group?

Ryan

unread,
Sep 12, 2017, 6:38:28 PM9/12/17
to PDFTron PDFNet SDK
The following code will find the activated instance of the check box.

FieldIterator itr;
for(itr=doc.GetFieldIterator(); itr.HasNext(); itr.Next())
{
   
Field field = itr.Current();
   
if (field.GetValueAsBool())
   
{
       
this is the field instance that is selected.
       
string str = field.GetValueAsString(); // name of selected choice
   
}
}

Reply all
Reply to author
Forward
0 new messages