0
JavaScript
New Here
,
/t5/acrobat-discussions/javascript/td-p/10651637
Oct 05, 2019
Oct 05, 2019
Copy link to clipboard
Copied
Hello Community,
I have found following code from the network to send a PDF - while required text boxes are checked for completeness ...
I would like to have check boxes marked as required checked as well. I've already tried to replace the text area with checkbox, but it does not work.
This is the code:
I would be very happy if someone can look at it.
Br
for(var i=0; i<this.numFields;i++){
var f = this.getField(this.getNthFieldName(i));
if (f.type == "text" && f.required == true && f.value == ""){
app.alert('Bitte Pflichtfeld ausfüllen! (Felder sind mit einem * markiert');
f.setFocus();
exit;
}
}
function absenden() {
var radio = document.querySelector('input[name = "checkbox"]:checked');
if (radio == null) {
alert("Bitte einen Button auswählen!");
return false;
}
}
var c_name = this.getField('Name Mitarbeiter').value;
var c_Pno = this.getField('Personalnummer').value;
var betreff = 'Zurückgesendet: Personalfragebogen von: ' + c_name + ' (Persnr.: ' + c_Pno + " ) ";
var body = 'Sehr geehrte Damen und Herren,';
this.mailDoc(false, "empfaenger@crown.de", "", "", betreff, body );
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
/t5/acrobat-discussions/javascript/m-p/10651661#M152990
Oct 05, 2019
Oct 05, 2019
Copy link to clipboard
Copied
The function "absenden" is Javascript code for browsers, not Adobe Acrobat.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
azemf56411038
AUTHOR
New Here
,
LATEST
/t5/acrobat-discussions/javascript/m-p/10651750#M153001
Oct 05, 2019
Oct 05, 2019
Copy link to clipboard
Copied
Hi, Danke für Deine Antwort. Weißt Du wie ich den Code umschreiben müsste?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

