跳到主要内容

设置复选框提示文本

为所有具有特定键值的复选框设置所需的提示文本。

(function () {
let doc = Api.GetDocument();
let allForms = doc.GetAllForms(); // 获取所有表单字段。
let targetKey = "CheckBox10"; // 指定要更新的复选框键值。
let newTip = "Please update your marital status."; // 新的提示文本。

allForms.forEach(function (form) {
// 检查字段类型是否为复选框且键值匹配目标键。
if (form.GetFormType() === "checkBoxForm" && form.GetFormKey() === targetKey) {
form.SetTipText(newTip); // 设置新的提示文本。
}
});
})();

使用方法: GetDocument, GetAllForms, GetFormType, GetFormKey, SetTipText

结果

TipTextSetter TipTextSetter