Categories > OpenTBS with DOCX >

Can OpenTBS alter checkboxes in a docx?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Alex Nicol
Date: 2014-01-10
Time: 15:51

Can OpenTBS alter checkboxes in a docx?

I have a webform that populates a docx using this plugin.  They now want a few YES NO options to be added.  In the docx this has been achieved by using checkboxes.  I have created these on the webform and saved them to a DB in a tinyint(1) format.  Can I use the saved DB to toggle the checkbox in the docx?
By: Skrol29
Date: 2014-01-11
Time: 00:38

Re: Can OpenTBS alter checkboxes in a docx?

Hi Alex,

It depends on how you are building the form in the DOCX.

Assuming you are using the control of the Developer tab, then you should not use the Checkbox Content Control, because it has two value to change.
It is better to use the Checkbox Form Control available in the Inherit Form controls set under the Inherited Tools button.

Doing so, the value can be changed by changing a single attribute in an element:
Checked : <w:default w:val="1"/>
Unchecked : <w:default w:val="0"/>

So the template could be :

[] (the checkbox is before this text) [b.checked;att=w:default#w:val]

The value of the field "b.checked" must be 1 ou 0.
By: Alex Nicol
Date: 2014-01-11
Time: 10:38

Re: Can OpenTBS alter checkboxes in a docx?

Hi Skrol

Thank you for such an informative response!

One final point of clarification if you please:-

Sales Generated [] [b.checked;att=w:default#w:val]
Inbound [] [b(1?).checked;att=w:default#w:val]
Website [] [b(2?).checked;att=w:default#w:val]
Other [] [b(3?).checked;att=w:default#w:val]

and so in the code in the php
$b = $_row['sales']
$b1 = $_row['inbound']
$b2 = $_row['website']
$b3 = $_row['other']

Thanks again for your time.

Kind Regards

Alex
By: Skrol29
Date: 2014-01-13
Time: 14:14

Re: Can OpenTBS alter checkboxes in a docx?

Hi Alex,

It depends if you want to use a block of only simple fields.

With simple fields :
PHP :
$TBS->MergeFields('row', $_row);
DOCX:
Sales Generated [] [row.sales;  att=w:default#w:val]
Inbound []         [row.inbound;att=w:default#w:val]
Website []         [row.website;att=w:default#w:val]
Other []           [row.other;  att=w:default#w:val]
By: Alex Nicol
Date: 2014-01-13
Time: 14:19

Re: Can OpenTBS alter checkboxes in a docx?

They are not in a block, there are other fields in between them.  but I think I can see the logic, I will have a bash and report back.

Thanks for your help