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

JavaScript

New Here ,
Oct 05, 2019 Oct 05, 2019
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 );

 

365
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 ,
Oct 05, 2019 Oct 05, 2019

The function "absenden" is Javascript code for browsers, not Adobe Acrobat.

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 ,
Oct 05, 2019 Oct 05, 2019
LATEST
Hi, Danke für Deine Antwort. Weißt Du wie ich den Code umschreiben müsste?
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