docusign / docusign-esign-php-client

The Official Docusign PHP Client Library used to interact with the eSign REST API. Send, sign, and approve documents using this client.
https://www.docusign.com/devcenter
MIT License
198 stars 123 forks source link

Checkbox $tabGroup->setMaximumAllowed('1') not working #89

Closed abarke closed 4 years ago

abarke commented 4 years ago

Seems $tabGroup->setMaximumAllowed('1') is not working as expected. I can still select both checkboxes in the online signing ceremony.

I built this solution from this example on stackoverflow: https://stackoverflow.com/a/58210277/11475075

// Tab Group for linking the Checkboxes
$tabGroup = new TabGroup();
$tabGroup->setGroupLabel(self::CHECKBOX_GROUP);
$tabGroup->setGroupRule('SelectAtLeast');
$tabGroup->setMinimumRequired('0');
$tabGroup->setMaximumAllowed('1'); # this is not working!
$tabGroup->setValidationMessage('Please check one box should you wish to opt-in');
$tabGroup->setTabScope('Document');
$tabGroup->setPageNumber('7');
$tabGroup->setDocumentId('1');
$tabGroup->setRecipientId('2');

Output:

"checkboxTabs": [
    {
        "documentId": "1",
        "pageNumber": "7",
        "recipientId": "2",
        "tabGroupLabels": [
            "CheckboxGroup"
        ],
        "tabLabel": "CheckBox Option 1",
        "xPosition": "80",
        "yPosition": "321"
    },
    {
        "documentId": "1",
        "pageNumber": "7",
        "recipientId": "2",
        "tabGroupLabels": [
            "CheckboxGroup"
        ],
        "tabLabel": "CheckBox Option 2",
        "xPosition": "80",
        "yPosition": "336"
    }
],
"tabGroups": [
    {
        "documentId": "1",
        "groupLabel": "CheckboxGroup",
        "groupRule": "SelectAtLeast",
        "maximumAllowed": 1,
        "pageNumber": "7",
        "recipientId": "2",
        "tabScope": "Document",
        "validationMessage": "Please check one box should you wish to opt-in"
    }
],
LarryKlugerDS commented 4 years ago

The possible groupRule values are SelectAtLeast, SelectAtMost, SelectExactly, SelectARange

If you want a maximum of 1, then set groupRule to SelectAtMost

The associated attributes are minimumRequired, maximumAllowed, as appropriate.

I have submitted Jira DEVDOCS-2087

abarke commented 4 years ago

Thanks @LarryKlugerDS I assume the minimumRequired option is taken into account if I set groupRule to SelectAtMost or could I use SelectExactly one to make sure the user must check a box, but only one box (radio).

LarryKlugerDS commented 4 years ago

No, I don't think that's right. If you want minimumrequired to be used in that way, you can't use selectatmost, use selectarange