abracadabraPDF › Forums › PDF – Général › Bouton de validation › Répondre à : Bouton de validation
18 septembre 2020 à 18:12
#67994
bebarth
Maître des clés
bonjour,
On part du principe où ton champ signature n’est pas visible :
Code:
this.getField(“champSignature”).display=display.visible;
J’ai réécris ton script, tu vérifieras si je n’ai pas fait d’erreur, car je n’ai pas testé vu que je n’ai pas ton fichier !
Code:
console.clear();
console.println(“Detection champ obligatoire vide.”);
var OK=1;
for (var indexField=0; indexField nameField=this.getNthFieldName(indexField);
ff=this.getField(nameField);
if(ff.required && (ff.type==”text” || ff.type==”combobox”)) {
console.println(indexField+”- Examen champ “+ff.type+” obligatoire “”+nameField+””.”);
console.println(“Valeur=”+ff.value);
if (ff.type==”text” && ff.value!=”” && ff.valueAsString.charAt(0)!=” “) {
console.println(“Saisie valide.”);
} else {
app.alert(“Saisie obligatoire manquante…r(champ “”+nameField+””).”,1);
OK–;
ff.setFocus();
//Sortie
break;
}
}
}
if (OK) {
app.alert(“Tous les champs obligatoires sont correctement remplis.”,3);
this.getField(“champSignature”).display=display.visible;
}
console.println(“Detection champ obligatoire vide.”);
var OK=1;
for (var indexField=0; indexField
ff=this.getField(nameField);
if(ff.required && (ff.type==”text” || ff.type==”combobox”)) {
console.println(indexField+”- Examen champ “+ff.type+” obligatoire “”+nameField+””.”);
console.println(“Valeur=”+ff.value);
if (ff.type==”text” && ff.value!=”” && ff.valueAsString.charAt(0)!=” “) {
console.println(“Saisie valide.”);
} else {
app.alert(“Saisie obligatoire manquante…r(champ “”+nameField+””).”,1);
OK–;
ff.setFocus();
//Sortie
break;
}
}
}
if (OK) {
app.alert(“Tous les champs obligatoires sont correctement remplis.”,3);
this.getField(“champSignature”).display=display.visible;
}
Tu me dis.
@+
:bonjour: