Can't set radioButton object's option.Selected to false

I am trying to set one of the options of radiobutton object’s options to “false”.

But setting it to false would only set it to “true” even if the original value was already “false”.
(Refer to the attached image)

How could I set the selected value to false when it’s setting it to true no matter what?
By the way, there are two form fields (of type RadioButtonField) named “PhpClaimFiledYN1”. One wit the name “YES”, another with “NO”.

foreach (Field field in document.Form.Fields)<o:p></o:p>

{

var radioButton = document.Form[field.FullName] as RadioButtonField;

if (radioButton == null) continue;

if (field.FullName != "PhpClaimFiledYN1") continue;

foreach (Option option in radioButton.Options)

{

option.Selected = false;

}

}

Hi Sung,


We are sorry for the inconvenience caused. We will appreciate if you please share your sample PDF form, so we will look into it and provide you information accordingly.

Best Regards,

Thanks Tilal.


This post was about the workaround for the problem I was having.
If i figure out the fundamental problem I wouldn’t need this workaround.

Anyways, the source & the PDF form is included as an attachment to this post.
Aspose.PDF Submit button generates &amp;quot;Expected a name object&amp;quot; error - #4 by dance2die - Free Support Forum - aspose.com


Hi Sung,


Thanks for sharing the details.

I have tested the scenario using Aspose.Pdf for .NET 9.1.0 where I have used the following code snippet and as per my observations, the radio button is properly being selected. For your reference, I have also attached the resultant PDF generated over my end.

[C#]

Document document = new Document(@“C:\pdftest\PdfFormEntry\bin\Forms\form.pdf”);<o:p></o:p>

foreach (Field field in document.Form.Fields)

{

var radioButton = document.Form[field.FullName] as RadioButtonField;

if (radioButton == null) continue;

if (field.FullName != "ReceivingMedicareYN") continue;

foreach (Option option in radioButton.Options)

{

option.Selected = false;

}

}

document.Save(@“C:\pdftest\PdfFormEntry\bin\Forms\form_Filled.pdf”);