跳到主要内容

Remove default values

Automatically removes a specific default value from all text fields in the entire document.

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

forms.forEach(form => {
if (form.GetFormType() === "textForm" && form.GetText() === defaultValue) {
form.Clear();
}
});
})();

Methods used: GetDocument, GetAllForms, GetFormType, GetText, Clear

Result

RemoveDefaultValues RemoveDefaultValues