Created java that highlights empty fields On Save. How do I save the cleared form (w/o highlights)?

Explorer ,
Aug 04, 2022 Aug 04, 2022

Copy link to clipboard

Copied

Cannot find this answer in forums, but it is so basic. 

 

Put a javascript in "Document Will Save" that highlights empty fields. How can I save my work, save a clean, cleared form for clients, without triggering the highlights? 

TOPICS
JavaScript , PDF forms

Views

33

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Aug 04, 2022 Aug 04, 2022
In the preferences deactivate JavaScript and save the form.

Likes

Translate

Translate
Adobe Community Professional ,
Aug 04, 2022 Aug 04, 2022

Copy link to clipboard

Copied

How are you applying these "highlights", exactly?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 04, 2022 Aug 04, 2022

Copy link to clipboard

Copied

In Document Actions > Document Will Save:

var department = this.getField("Department");

var emplFirst = this.getField("Employee First Name Field");

 

if (department.value==""){

department.strokeColor = color.red;

department.borderStyle = border.s; }

if (emplFirst.value=="First"){

emplFirst.strokeColor = color.red;

emplFirst.borderStyle = border.s; }

if (department.value=="" || emplFirst.value=="First") {

app.alert("Please ensure all required fields are completed.")

}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 04, 2022 Aug 04, 2022

Copy link to clipboard

Copied

To reverse it you can use something like this:

 

department.strokeColor = color.transparent;

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Aug 04, 2022 Aug 04, 2022

Copy link to clipboard

Copied

LATEST

In the preferences deactivate JavaScript and save the form.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines