Forum


Replies: 4   Views: 418
Question about adding form elements on the same line as text
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by tjchen  · 20-04-2023 - 08:53

Dear phpdocx support team,

I am using phpdocx to generate Word documents and I have a question about adding form elements on the same line as text. I am currently using the following code:

$item->addText('1.1', ['font' => 'Arial', 'fontSize' => 8, 'indent_left' => 10]);
$item->addFormElement('select', ['selectOptions' => [' 0 ', ' 1 ', ' 2 ', ' 3 ']]);

However, this adds the form element on a new line instead of on the same line as the text. Is there a way to add form elements on the same line as text using phpdocx?

Thank you for your help.