跳到主要内容

清除复选框

清除文档中的所有复选框。

(function() {
let doc = Api.GetDocument();
let forms = doc.GetAllForms();

// 遍历所有表单字段,如果已勾选则取消勾选。
forms.forEach(function(form) {
if (form.GetFormType() === "checkBoxForm" && form.IsChecked()) {
form.SetChecked(false);
}
});
})();

使用方法: GetDocument, GetAllForms, GetFormType, IsChecked, SetChecked

结果

CheckboxUnchecker CheckboxUnchecker