Avatar

Correct answer by
Level 10

Hi,

you can check the number of attachments the following way:


if (event.target.dataObjects) {


    // When there are attachments


     var o = event.target.dataObjects.length;


    xfa.host.messageBox("There " + (o > 1 ? "are " : "is ") + o + (o > 1 ? " files" : " file") + " attached.");


} else {


  // When there are no attachments


  xfa.host.messageBox("There are no files attached");


}


View solution in original post