Is it posssible, using addFormElement, to display a label alongside the form element?
For example, if I use addFormElement to insert a checkbox, how would I position text directly inline alongside it?
🏷️ Limited Offer: 25% OFF 🏷️
First 100 purchases only — Special discount!
Use this coupon on checkout: PHPDXPJ_D1SC1N5T
Get it nowIs it posssible, using addFormElement, to display a label alongside the form element?
For example, if I use addFormElement to insert a checkbox, how would I position text directly inline alongside it?
Hello,
You can generate an array of contents to add inline contents in the same paragraph (using WordFragments and text contents).
For example, to add a checkbox and a text content:
$docx = new CreateDocx();
$checkboxFragment = new WordFragment($docx);
$checkboxOptions = array('fontSize' => 12, 'defaultValue' => true);
$checkboxFragment->addFormElement('checkbox', $checkboxOptions);
$text = array();
$text[] = $checkboxFragment;
$text[] = array(
'text' => ' A checkbox',
'bold' => true,
);
$docx->addText($text);
$docx->createDocx('output.docx');In addition to this sample, we recommend you check the following:
If you need further support about this task we can generate a more sophisticated example.
Regards.