Forum


Replies: 1   Views: 181
Add structuredtag of type 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 aventyret  · 03-12-2024 - 10:17

If you just add 'text' in this function in CreateDocx.php:
 

public function addStructuredDocumentTag($type, $options = array())
{
    $options = self::setRTLOptions($options);
    $sdtTypes = array('checkbox', 'comboBox', 'date', 'dropDownList', 'richText', 'text');

and then in CreateStructuredDocumentTag.php
 

if (isset($args[0]) && $args[0] == 'text') {
    if (isset($args[1]['placeholderText']) && !empty(isset($args[1]['placeholderText']))) {
        $sdtPr .= '<w:showingPlcHdr/>';
    }
    $sdtPr .= '<w:text />';
}

It's possible to add simple text inputs instead of only richText, and then tabbing between inputs will work fine.

Posted by admin  · 03-12-2024 - 12:15

Hello,

Thanks for your feedback. We have sent it to the dev team to consider adding it in the next stable release.

Regards.