nehme | Posts: 153

CheckBox Inject Field

0 votes
Hello, I inject a CheckBox with 'X', while signing, getting this message 'Form is inComplete'. Please provide help about this issue. Thanks

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Can you explain in more detail, please? Are you using OneSpan Sign's injected field capability to flatten an X into a checkbox on your document and getting this issue? Or something else?

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, Yes I am using SDK to injected field capability to flatten an X into a checkbox on your document. All the fields injection working fine except for the Checkbox Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Hey Nehme, Could you send the code you're using and attach a sample document (no confidential or personal info, please) so I can reproduce the issue?

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Also, if you could let me know your SDK version, that would be great, too.

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, template.Documents[y].Signatures[s].Fields[f].Value = 'X' I am using this command to inject all the fields in the form. Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Any chance you could send me a sample document with all relevant code for the document so I can start with exactly what you have? And also give me your SDK version and the OneSpan Sign instance you're using. Thanks!

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, The SDK version is 11.19.0.0. What is the inject field value for checkbox if you do not want to check it? Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Hey Nehme, I'm a bit confused, I think. If you didn't want to inject a value into the document, you just wouldn't tell OneSpan Sign that you want to use a field from your PDF document and it would just be ignored. In OneSpan Sign, an injected field is a value you push into your document through a PDF Form Field. It's an actual field type in the SDK. This field type is not editable by the signer as the value becomes a flattened part of the document itself. To OneSpan Sign, a field that is editable by the signer is just called a field, not an injected field. So, if you're trying to put a "default value" into a field that will be able to be changed by the signer, we can do that. If you're wanting to actually flatten an injected value into the document via an injected field that the signer will not be able to modify, we can also do that. Let me know what you're trying to do and I'll help you get what you need.

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, Everything working fine with me for injecting fields but when I inject a value for the check box, I am getting the message the form is in complete. If I do not inject any value for checkbox I am not getting this in complete message. I am injecting the checkbox with 'X'. Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
That should be the proper value. Let me do a few quick tests!

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, Yes Please. I will wait your feedback. Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Hey Nehme, Sorry for the delay. I was having issues testing in sandbox. I found that injected fields currently has a bug, in sandbox US where the value does not get applied to the injected field. This has not been released to production and I am unable to reproduce your issue in production. Here is my code to set the injected field value with the .NET SDK:
DocumentPackage mydocpackage = PackageBuilder.NewPackageNamed("Injected Field Test")
                                                .WithSigner(SignerBuilder.NewSignerWithEmail("[email protected]")
                                                    .WithCustomId("signer1")
                                                    .WithFirstName("Test")
                                                    .WithLastName("Signer"))
                                                .WithDocument(DocumentBuilder.NewDocumentNamed("TestDoc")
                                                    .FromFile("C:/filepath/sampleAgreement_InjectedFields.pdf")
                                                    .WithSignature(SignatureBuilder.SignatureFor("[email protected]")
                                                        .WithName("SignerSignature")
                                                        .WithPositionExtracted())
                                                    .EnableExtraction()
                                                    .WithInjectedField(FieldBuilder.CheckBox()
                                                        .WithName("mycheckbox")
                                                        .WithId("mycheckbox")
                                                        .WithValue("X")))
                                           .Build();

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, Thanks for your answer. I am doing this test in Production account CA. The code I am using to inject the fields is this: List signatureList = curDoc.Signatures; foreach (var signature in signatureList) { List fieldList = signature.Fields; foreach (var curField in fieldList) { curField.Value = "xxx"; } db.WithSignature(signature); } So when I inject Checkbox with value = "X", the message will show the form is in complete. Only the checkbox injection is not working. Can you help in this issue please. Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Hey Nehme, It appears that what you're doing is not an "injected field" but a standard field, as I described above. If the field is for the signer to interact with, it's not injected. It's just a field. Canadian production works fine with "injected fields". I will test with a "default value" for a "standard field", now. I will let you know.

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
I am able to set the default value without issue, as well. I did notice something odd if I specify the ID of a field, in my .NET SDK code. I get this error when I try to sign: "Something went wrong and your request could not be completed. Please try again." If I do not set an ID for the field, I do not receive this error and the transaction completes as expected. This happens for all field types, it seems, so, probably isn't the issue you're having. Otherwise, if I set the default value to selected, with the checkbox required or not required, I do not have any issues. I'll try a couple more things and update you.

nehme | Posts: 153

Reply to: CheckBox Inject Field

0 votes
Hello, Thanks for the update. Did you try to sent the value for the check box as 'X' using .net SDK? Thanks, Nehme

mwilliams | Posts: 957

Reply to: CheckBox Inject Field

0 votes
Yes. I am using the .NET SDK v11.19 against Canada Production environment. I even tried setting the value after the checkbox already existed in a package:
Field myField = eslClient.GetPackage(mypackage).Documents[1].Signatures[0].Fields[0];
            myField.Value = "X";
            eslClient.ApprovalService.ModifyField(mypackage, "mydoc", mysignatureId, myField);
This works to set the value after the field already exists. IF you are requiring the check box, it has to be selected to sign the document. If you don't want the checkbox value to be required to be checked, remove the "required" validation from the checkbox. If you set the check box to required and do not select it, you will get an error about a required checkbox. Let me know.

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off