Skip to main content
Mi.Fie
Participant
March 4, 2022
Question

Erforderliches Pflichtfeld ist leer, wird aber nicht als Fehler gemeldet

  • March 4, 2022
  • 2 replies
  • 1270 views

Guten Tag.

 

Seit kurzem arbeite ich mit der Version Adobe Acrobat Pro 2020. Nun werden in meinem Formlar Pflichtfelder zwar rot dargestellt, sobald die Eigenschaft "erforderlich" hinterlegt wurde. Jedoch kann der Anwender das Formular ohne eine Fehlermeldung per E-Mail senden. Hat jemand einen Tipp für  mich, an was das liegen könnte?

 

Vielen Dank.

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
March 5, 2022

Try this script:

 

var nCompt = 0;
for (var i=0; i<this.numFields; i++) {
var oChamp = this.getField(this.getNthFieldName(i));
if (oChamp != null && oChamp.required == true && oChamp.value == oChamp.defaultValue) {nCompt++;}
}
if (nCompt == 0) {
var c_vname = this.getField('Vorname').value;
var c_nname = this.getField('Nachname').value;
var betreff = 'Neues Formular: ' + c_vname + ' ' + c_nname;
var body = 'Neues Formular: ' + c_vname + ' ' + c_nname;
this.mailDoc(false, "xxx@yyy.de", "", "", betreff, body );
}
else {app.alert("Please fill required fields before sending this document.");}

Acrobate du PDF, InDesigner et Photoshopographe
JR Boulay
Community Expert
Community Expert
March 4, 2022

You must use the built in "Submit Form" action, not JavaScript.

Using JavaScript you must add your own script to check required fields before submitting.

Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
March 4, 2022

Not necessarily. If you use the submitForm method it will validate the required fields automatically.