Free Support Forum - aspose.com

form.FillField(checkBoxName-"chkItem1"); Not working

First off, thank you for all of your help and quick replies, they have been invaluable as I have a product demo tomorrow and you have been a tremendous help.

In our pdfs we have checkboxes named “chkPacId1”,“chkPacId2”,…

Using form.FillField(“chkPacId1”,“chkItem1”) does not check the boxes. Is there something I’m doing wrong?

Thanks,
Peter Newell

P.S.
The “Email me replies to this post” function of the forums doesn’t seem to work either.

Dear CLAMXO,

Thanks for your praise. I will try my best to provide better service for our customers.

I think the problem may be that you set a wrong field name or value to the checkbox because the sample pdf I provide in api refference works well. So please check the field name and value well, especially they are case sensitive.

If you can’t solve that problem still, you could send me you template pdf and the code.

PS.
If the “Email me replies to this post” function dosen’t work, you can contact the hangzhou@aspose.com. They are always online of MSN.

Best regards.

Dear CLAMXO,

Thanks for your praise. I will try my best to provide better service for our customers.

I think the problem may be that you set a wrong field name or value to the checkbox because the sample pdf I provide in api refference works well. So please check the field name and value well, especially they are case sensitive.

If you can’t solve that problem still, you could send me (pdf.form@aspose.com) your template pdf and the code.

PS.
If the “Email me replies to this post” function dosen’t work, you can contact the hangzhou@aspose.com. They are always online of MSN.

Best regards.

By the way, the fields will be lost after they have been flattened without setting value.

Okay can I ask a very stupid question. Lets say I have 4 checkboxes… more like a CheckBox group if you were programming. Only one can be selected. (Single, Married, Divorced, Seperated).

I copied the code from the example and changed the code accordingly. Names etc… but it did not check anything. I think I might be having the same problem as the other guy here.

Do I name the checkboxes the same and check item1, 2, 3 etc? That doesnt seem to be how the function works… It seems to me we name them different things and use chkItem1 to check and chkItem2 to uncheck… is that correct?

Thanks
Corey

Okay,

I think that the documentation needs to be expanded for CheckBox and RadioButtons.

First off… in Acrobat there are no Radio Groups. You are simply naming the buttons all the same. Thus the EXPORT VALUE is what you use as the second parameter in the form.fillfield() function. An example might be:

Select Case dr(“Marital_Status”)
Case “Single”
form.FillField(“rbMarital_Status”, “Single”)
Case “Married”
form.FillField(“rbMarital_Status”, “Married”)
Case “Seperated”
form.FillField(“rbMarital_Status”, “Seperated”)
Case “Divorced”
form.FillField(“rbMarital_Status”, “Divorced”)
End Select

The above is a much better example than the one in the current documentation. The same thing needs to be done with CheckBoxes so that we all understand them better. (I personally would have made the function do something likeSmile

form.FillField(“chkBoxName”, checked) or unchecked to make it closer to .net.

Thanks
Corey

Dear Corey10e,

Thank you very much for your good advices.
We will provide better demo and documentation ASAP.
In next version, a calssical demo about database integration will be provided. I wish you will pay attention to our Aspose.Pdf.Form and give us more advices and requirement.

Thanks again.
Best regards.