Ryan_Coleman | Posts: 258

Default value for checkbox

0 votes
I am able to create the checkbox using the examples on the site but is there a way to set a checkbox to checked by default?

Approved Answer
Duo_Liang | Posts: 3776

Reply to: Default value for checkbox

0 votes
Hi Ryan, Is there a special reason that you set your checkbox field in a rectangle instead of a square (keep width&height same) like below? Because I saw you had a square shape checkbox background layer on your pdf.
{
              "binding": null,
              "page": 0,
              "top": 458.9000000000002,
              "subtype": "CHECKBOX",
              "height": 10.3974609375,
              "left": 91.0,
              "width": 10.3974609375,
              "type": "INPUT",
              "value": "true"
            }
Duo

Duo_Liang | Posts: 3776

Reply to: Default value for checkbox

0 votes
Hi Ryan, To set a checkbox checked by default, you can set value "X"/"x"/"true" ("X" is the most recommanded) for this field in your json, here's some sample json:
"fields": [
        {
            "binding": null,
            "validation": {
                "required": false,
                "maxLength": null,
                "minLength": null,
                "enum": null,
                "errorMessage": "",
                "errorCode": null,
                "pattern": ""
            },
            "id": "F9p2IlVxNMMI",
            "data": null,
            "subtype": "CHECKBOX",
            "top": 97,
            "page": 0,
            "extract": false,
            "width": 26,
            "height": 26,
            "left": 436,
            "extractAnchor": null,
            "type": "INPUT",
            "value": "X",
            "name": ""
        }
]
Hope this could help you! Duo

Ryan_Coleman | Posts: 258

Reply to: Default value for checkbox

0 votes
Duo, That worked, thank you! I tried "checked" and "true" in the value field but I never thought to try "X". Anyways, pleas see the attached img. Is this default behavior? The checkbox is actually above where it supposed to be, when signing.

Attachments
Duo_Liang | Posts: 3776

Reply to: Default value for checkbox

0 votes
Hi Ryan, Did you any extraction methods on your document? Can you share more info about how you create this field? Duo

Ryan_Coleman | Posts: 258

Reply to: Default value for checkbox

0 votes
Duo, I am creating this field at the same time as the other fields on the page. I'm building my approvals and this is an example that is created and sent up.
            {
              "binding": null,
              "page": 0,
              "top": 458.9000000000002,
              "subtype": "CHECKBOX",
              "height": 29.0,
              "left": 91.0,
              "width": 10.3974609375,
              "type": "INPUT",
              "value": "true"
            },

Duo_Liang | Posts: 3776

Reply to: Default value for checkbox

0 votes
Hi Ryan, Sorry for the confusion of last reply, if you are setting your checkbox field to a rectangle, before signature is confirmed, it showed up in a small square. But after confirmation, it will fill the whole box. If it's an inconvenience to you, you can post here and I will report to PM team and have them investigate this. Duo

Ryan_Coleman | Posts: 258

Reply to: Default value for checkbox

0 votes
Duo, Is there another way of doing this? Is this not the recommended way and is there an example of another way?

Ryan_Coleman | Posts: 258

Reply to: Default value for checkbox

0 votes
Duo, We are using white text to get coordinates of where we want to place the checkbox. The same kind of logic that we use for our signing fields or labels, etc.

Ryan_Coleman | Posts: 258

Reply to: Default value for checkbox

0 votes
Duo, After setting it to a square I am now pleased to say that this solved the issue. The checkbox is right where it needs to be.

Duo_Liang | Posts: 3776

Reply to: Default value for checkbox

0 votes
Hi Ryan, Glad to hear that you solved your issue and thanks for sharing this way of getting coordinates with us! Duo

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