• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Create a form with required fields to fill out

New Here ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Hi everyone, I am creating PDF forms with text fields to be filled in and I wish the document could not be saved if these fields are not filled in. I have set the fields as mandatory but there seems to be no difference between mandatory and non-mandatory fields and the document can be easily filled in without rules. How can I force this thing? Has anyone already had similar experiences or needs?

TOPICS
PDF forms

Views

400

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

Community Expert , May 18, 2022 May 18, 2022

You can use this script:

 

var nCompteur = 0;
for (var i=0; i<this.numFields; i++) {
var oFld = this.getField(this.getNthFieldName(i));
if (oFld.type != "button" && oFld.type != "signature" && oFld.required == true && oFld.value == oFld.defaultValue) {
nCompteur = nCompteur + 1;}
}
if (nCompteur != 0) {app.alert(nCompteur + " required fields are not filled in." );}

 

 

 

Capture_430.png

Votes

Translate

Translate
LEGEND ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

"Required" forms applies only to submit actions. It doesn't block saving, which is very important as people often need to save half-completed forms to come back later.

 

In general, submitting to an https server (NOT email) and not saving is the way forward. Saving has all sorts of other issues, like overwriting work by accident.

Votes

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
Community Expert ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

It would be penalizing, a user may have many good reasons to want to save a form being filled out to finish it later.

It is more user-friendly to simply display an alert when saving (using a script in : Document Actions : Document Will Save).

Votes

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
New Here ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

Is it possible with Adobe Acrobat to insert this notice to warn the user that not all the forms have been filled in and that he can continue and save or go back and continue?

Votes

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
Community Expert ,
May 18, 2022 May 18, 2022

Copy link to clipboard

Copied

LATEST

You can use this script:

 

var nCompteur = 0;
for (var i=0; i<this.numFields; i++) {
var oFld = this.getField(this.getNthFieldName(i));
if (oFld.type != "button" && oFld.type != "signature" && oFld.required == true && oFld.value == oFld.defaultValue) {
nCompteur = nCompteur + 1;}
}
if (nCompteur != 0) {app.alert(nCompteur + " required fields are not filled in." );}

 

 

 

Capture_430.png

Votes

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