Skip to main content
Solved

Changing Radio Button Size with API

  • 19 June 2024
  • 5 replies
  • 87 views

I am working on converting a bunch of hand written forms to DocuSign.  Our system uses the DocuSign API and connects to it using the C# .NET SDK.

This works well for most fields and anchor tags but, recently, we have started adding fields like checkboxes and radio buttons.  However, it appears that radio buttons do not have any sort of measurement associated with them in their class (no scale, no width/height, etc.).  The only size related field I can find is fontsize, but changing that does not appear to change the size of the radio button.

Is there any way to change the size of a radio button for a form submitted through the DocuSign API?

@bkeath 

Unfortunately, DocuSign’s API and UI currently do not provide a direct way to adjust the size of radio buttons. The fontsize attribute affects only the text associated with the button, not the button's actual size.


@JohnSantos thank you for your quick reply on this.

Since DocuSign’s API does not provide a direct way to adjust the size of radio buttons, do you know if it allows users to customize the size of checkboxes?  On checkboxes, there is a width and height attribute, but when I change those it does not appear to actually change the size of the checkbox.  In either case, I will have to use checkboxes in this case because radio buttons are way too big to fit in this form.

Additionally, I am attempting to add validation to the checkboxes in order to make them work like radio buttons.  However, the validation is not being enforced in DocuSign once I send it.  I have checked the documentation and other questions which have asked the same thing, but I am not sure what I am missing (code is in C# using the NET SDK):

 

TabGroup tabGroup = new TabGroup();
tabGroup.GroupLabel = anchorTag.AnchorTagText;
tabGroup.TabScope = "Document";
tabGroup.TabType = "tabgroup";
tabGroup.GroupRule = "SelectAtLeast";
tabGroup.MaximumAllowed = "1";
tabGroup.MinimumRequired = "1";
tabGroup.ValidationMessage = "Please check a box";
tabGroup.DocumentId = "1";
tabGroup.PageNumber = "1";
tabGroup.TabScope = "Document";
tabGroup.RecipientId = "1";
groups.Add(tabGroup);

 

Later in the code, I add the checkboxes and have them use the group label to tie them to the tab group:
 

Checkbox checkbox = new Checkbox();
var groupLabels = new List<string>();
groupLabels.Add(groupLabel);
checkbox.TabGroupLabels = groupLabels;
checkbox.AnchorString = anchorTag.AnchorTagText;
checkbox.TabLabel = anchorTag.AnchorTagText;
checkbox.Required = requiredField;
docuSignTabs.CheckboxTabs.Add(checkbox);

 

Later on, once I have created the full list of groups, I add the group to the tabs:

 

docuSignTabs.TabGroups = groups;

 

Does anyone know why this tab group is not getting validated?  Based on the documentation, I think I am properly tying the checkboxes to their respective tabGroups, but since the validation is not working, I am not confident about that.  Can anyone see a glaring issue with my code above?  Does anyone have any advice?  Is there a way I can use the API to look at the anchor tags for a document after I send it (to see if the checkboxes are getting properly tied to groups)?


@bkeath 

The DocuSign API allows you to customize checkbox sizes using the width and height attributes. However, these attributes often do not change the actual appearance of the checkbox in the document. This is a known limitation in DocuSign, where the visual representation of checkboxes and other elements can be inconsistent.

To make checkboxes behave like radio buttons, you need to use the TabGroup feature correctly. The issue might be due to how the checkboxes are being tied to the tab group or how the validation rules are set.

Try this..

TabGroup tabGroup = new TabGroup { GroupLabel = "MyCheckboxGroup", TabScope = "Document", TabType = "checkbox", GroupRule = "SelectExactly", MaximumAllowed = "1", MinimumRequired = "1", ValidationMessage = "Please select one option", DocumentId = "1", PageNumber = "1", RecipientId = "1" };

 


@JohnSantos I attempted the changes you suggested, but still do not see any validation on the checkboxes (and it lets me submit the form without checking any of them).

I added some logging to get the group tabs and checkboxes.  Here is what I get at the end of it all (this is exactly what gets sent to the DocuSign API):

Group Tab 1: { "documentId": "1", "groupLabel": "DocSLoseTimeYN", "groupRule": "SelectExactly", "maximumAllowed": "1", "minimumRequired": "1", "pageNumber": "1", "recipientId": "1", "tabScope": "Document", "tabType": "tabgroup", "validationMessage": "Please select one option" }

Checkbox 1: { "anchorString": "DocSLoseTimeNo", "tabGroupLabels": : "DocSLoseTimeYN" ], "tabLabel": "DocSLoseTimeNo" }

6/20/2024, 3:24:56.020 PM

Checkbox 2: { "anchorString": "DocSLoseTimeYes", "tabGroupLabels": : "DocSLoseTimeYN" ], "tabLabel": "DocSLoseTimeYes" }


@bkeath 

It looks like you're setting up the checkbox group correctly.  I’m not sure what might be the issue here.


Reply