-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for other form elements #266
Comments
I checked http:https://www.schemacentral.com/sc/ooxml/s-wml.xsd.html and http:https://msdn.microsoft.com/en-us/library/documentformat.openxml.wordprocessing.formfielddata(v=office.14).aspx but couldn't find other form element except checkbox, textbox and drop-down list. There are some aother fields but they need to be used visual basic 6 coding within developer menu. |
Apparently you're right. Is it worth to develop them (textbox and dropdown element)? |
TextBox is also exist, we only need to check for dropdown and i guess it'll be done in a few hours :) |
The TextBox that we have is not a form element :) It's this one: http:https://www.phpdocx.com/img/sampleScripts/WordContent/example_addTextBox_1.png |
Feature added. See |
Hi ivanlanin, Thanks, |
Use $textrun->addFormField('dropdown')
->setEntries(array('Choice 1', 'Choice 2', 'Choice 3'))
->setValue(1); // select Choice 2 |
Thanks for your reply. Is it possible? Thakns, |
@ivanlanin Could you add them in recipes ? |
What i mean is : |
@pallikiran The OOXML schema for @Progi1984 This info should be in the main documentation when we remove the "To be completed" statement 😄 |
Affirmative :) |
@ivanlanin... Is it possible to use w:listItem instead of w:listEntry for dropdown? |
is it possible to use "w:attr" in PHPWord? |
You can change line 156-158 of Writer/Word2007/Element/FormField.php into: foreach ($entries as $key => $val) {
$xmlWriter->writeElementBlock('w:listEntry', array('w:val' => $val, 'w:key' => $key));
} But I don't think we will integrate this "hack" into the main PHPWord code because it's not a standard OOXML attribute. |
Why not create a writeComboBox method with w:listItem which supports w:value & w:displayText for each item ? |
Good idea. This will open up the possibility to implement other SDT elements. @pallikiran Can you open a new issue for this? The original issue has been closed. Thanks. |
SDT ? |
Structured document tag. I've read about SDT but haven't found it useful until now. Perhaps it's time to support it. |
Hi ivanlanin,
Thanks, |
Hi @pallikiran,
$row1 = $section->addTable()->addRow();
$row1->addCell()->addFormField('textinput')->setValue('1');
$row1->addCell()->addFormField('dropdown')->setEntries(array('Banana', 'Apple'));
$row1->addCell()->addFormField('checkbox');
$row2 = $section->addTable()->addRow();
$row2->addCell()->addFormField('textinput')->setValue('2');
$row2->addCell()->addFormField('dropdown')->setEntries(array('Linux', 'Windows', 'Mac'));
$row2->addCell()->addFormField('checkbox');
$row3 = $section->addTable()->addRow();
$row3->addCell()->addFormField('textinput')->setValue('3');
$row3->addCell()->addFormField('dropdown')->setEntries(array('PHPWord', 'PHPExcel'));
$row3->addCell()->addFormField('checkbox'); |
And please open a new issue :) |
From CodePlex. Currently we only have CheckBox.
The text was updated successfully, but these errors were encountered: