Christian Poulin
Christian Poulin

Reputation: 1

docusign how to configure RadioGroup

I try to insert Radio Buttons to my PDF I use SignatureHereTabs, DateSignedTabs, TextTabs, CheckBoxTabs and this works fine, but with radio buttons, I don't know how to set all the properties correctly.

my PHP CODE:

$radio1 = new \DocuSign\eSign\Model\SignHere();
$radio1->setXPosition("100");
$radio1->setYPosition("215");
$radio1->setDocumentId("1");
$radio1->setPageNumber("1");
$radio1->setRecipientId("1");
$radio1->setTabLabel("labelRadio1");
$radio1->setName("NameRadio1");                     
//$radio1->setGroupName("GroupRadio");          // NOT WORKING
//$radio1->setValue("valueRadio1");             // NOT WORKING

$radio2 = new \DocuSign\eSign\Model\SignHere();
$radio2->setXPosition("130");
$radio2->setYPosition("215");
$radio2->setDocumentId("1");
$radio2->setPageNumber("1");
$radio2->setRecipientId("1");
$radio2->setTabLabel("labelRadio2");
$radio2->setName("NameRadio2");                 
//$radio2->setGroupName("GroupRadio");              // NOT WORKING
//$radio2->setValue("valueRadio2");                 // NOT WORKING

$tabs = new DocuSign\eSign\Model\Tabs();
$tabs->setRadioGroupTabs(array($radio1,$radio2));

==>
setGroupName and setValue Not Working 
==>
No buttons appear on the PDF instead CheckBox works fine

What's wrong? Thanks

Upvotes: 0

Views: 471

Answers (1)

Praveen Reddy
Praveen Reddy

Reputation: 7383

You are incorrectly using using the SignHere tabs.

For radio buttons you should use \DocuSign\eSign\Model\Radio() SDK link

The radio buttons should then be added to DocuSign\eSign\Model\RadioGroup() SDK link

I have updated your code to use Radio and RadioGroup

$radio1 = new \DocuSign\eSign\Model\Radio();
$radio1->setXPosition("100");
$radio1->setYPosition("215");
$radio1->setPageNumber("1");        
$radio1->setValue("valueRadio1");             

$radio2 = new \DocuSign\eSign\Model\Radio();
$radio2->setXPosition("130");
$radio2->setYPosition("215");
$radio2->setPageNumber("1");                     
$radio2->setValue("valueRadio2");        

$radioGroup = new DocuSign\eSign\Model\RadioGroup();
$radioGroup->setDocumentId("1");
$radioGroup->setGroupName("GroupRadio");   
$radioGroup->setRadios(array($radio1,$radio2))

$tabs = new DocuSign\eSign\Model\Tabs();
$tabs->setRadioGroupTabs(array($radioGroup));

See this answer for the json example when using RadioGroup.

Upvotes: 2

Related Questions