Nintex Forms – Conditionally Require User to add Attachment

It is very easy to make the attachment field mandatory in the form you developed with Nintex Forms. You can go directly to the properties of the attachment control and make a number other than the minimum number of attachments 0.

But if you want to do this when a condition is met, unfortunately, Nintex Forms does not have a ready function for it. To do this, you must first go to the settings section of your form and register a javascript function as below.

function GetNumberOfAttachments(attCtrlClassName) {
    return NWF.FormFiller.Attachments.GetAttachedFilesCount(NWF.FormFiller.Functions.GetFillerDivObjectForControl(NWF$("#" + NWF$("." + attCtrlClassName + " .nf-attachmentsRow")[0].id)).data('controlid'))
}

Then you can create a validation rule above your attachment control and add a condition like below to the formula field. Define a css class to your Attachment control and use this css class name when calling the function.

GetNumberOfAttachments("Control CSS Class") < 1

Add a Comment

Your email address will not be published. Required fields are marked *