I have check boxes adding attachments to a form. On clicking a Submit button, I need a script to check for an attachment if the corresponding check box is selected. Any suggestions?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
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");
}
Views
Replies
Total Likes
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");
}
Views
Replies
Total Likes
Hello,
I have a checkbox that should be checked if there are files attached. I have the following script in the layout:ready event of the checkbox field, but it doesn't work. I have tried putting form1.execCalculate() in different areas of the form, but nothing seems to work. The only time the box gets checked is when drop-downs in the form are used. Any help would be appreciated.
if (event.target.dataObjects) {
this.rawValue = "1";
}
else {
this.rawValue = "0";
}
Views
Replies
Total Likes
Views
Likes
Replies