Need dedicated support? Click here
Need dedicated support?
Click here

CreateCheckBoxForm background color issue

In the latest version, I created the form using the following code, setting RGB(255,255,255) via CreateTextPr’s SetShd
However, the default color background will appear

var oDocument = Api.GetDocument();
var oCheckBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": true});
var oTextPr = Api.CreateTextPr();
oTextPr.SetShd("clear", 255, 255, 255);

Another problem is that the created form cannot be selected

Hello @GGbeng

First of all, please specify which SetShd method are you using exacty.

In general, can you share what are you trying to achieve? Do you want to have only checkbox with set background color? If it is so, then you can try setting it up like this:

var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
var oCheckBoxForm = Api.CreateCheckBoxForm({"key": "Marital status", "tip": "Specify your marital status", "required": true, "placeholder": "Marital status", "radio": false});
oParagraph.AddText("Adding some test for the reference");
var oRange = oDocument.GetRange(0, 0);
oRange.SetShd("clear", 255, 111, 61);

Here I’ve used SetShd and CreateCheckBoxForm methods for the reference.

The check-box form created with CreateCheckBoxForm method can be selected within Forms. You can test it out by creating an OFORM or DOCXF document, adding this form then going to Forms tab on the main toolbar and pressing View Form button.

Thanks for the reply, I still have the background color issue using the example builder code as shown in figure

Please note that checkbox form created with method CreateCheckBoxForm is a part of Forms API, it will be always highlighted as a form that can be filled.

If you are developing a plugin, you can insert Content Control check box with AddContentControlCheckBox method.