AnsweredAssumed Answered

Attachment Validations and Minimums

Question asked by warwick on Nov 3, 2014
Latest reply on Jul 7, 2016 by themos

Related to the Nintex Forms for SharePoint 1.6 (only tested on SP2010).

 

Custom JavaScript attachment validation changes with the new version. This is still required if you only want to validate attachment based on a selection on the form (maybe, unless someone know how to enter a formula below)

 

// Run Validation on Attachments
function ValidateAttachment(source, arguments) {
      var Control = NWF$("#" + CtrlControl).val();
      var elm = NWF$("table[id*=idAttachmentsTable]");

 

     // PRE ATTACHMENT CONTROL CHANGE
           var elmAttachmentRow = NWF$("table[id*=idAttachmentsRow]");

      // POST ATTACHMENT CONTROL CHANGE

           var elmAttachmentRow = NWF$("div[id*=idAttachmentsRow]");


      if ((elm != null && elm.prop('rows').length > 0) && (elmAttachmentRow != null)) {
           arguments.IsValid = true;
      }
      else {
           if (Control == "Yes") {
           arguments.IsValid = false;
           alert("Attachment Required")
           }
      }
}

 

The above code is based on Nintex Forms - Attachment Required - Vadim Tabakman

-----------------------------------------------------------------------------------------------------------------------------------

 

New attachments control with Minimum Attachments. Works great but it seems it's either on or off, you can't base it on a form control selection.

 

Question: Is it possible to to have a formula in the Minimum Attachment settings that is say based on (Choice control = "Yes") = minimum attachments = 1 \ if "No" minimum attachments = 0

Outcomes