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

Create a form with required fields to fill out

New Here ,
May 18, 2022 May 18, 2022

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
1.1K
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
May 18, 2022 May 18, 2022
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.pngexpand image


Acrobate du PDF, InDesigner et Photoshoptographe

View solution in original post

Translate
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
LEGEND ,
May 18, 2022 May 18, 2022

"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.

Translate
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

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).


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
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

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?

Translate
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
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.pngexpand image


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
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