Validate Attachments when a specific question is answered


Userlevel 2
Badge +9

So I'm trying to require attachments when a specific question is asked.  So I followed Nick Hurst's article on how to do this.  Nintex Forms conditionally require attachments – SharePoint and Nintex OOTB.  So I have to alter it a bit as what selection I'm using is a tad different than what he uses.  I have the following drop down control set like his parameters require

214136_pastedImage_2.png

214137_pastedImage_3.png

214138_pastedImage_4.png

I here is what I have in for my JS

function validateAttachments(source, arguments)
{
var elm = NWF$(‘.nf-attachmentsTable’);
var requesttypeValue = NWF$(‘#’ + RequestTypeClientID).val();
arguments.IsValid = true;if (requesttypeValue == ‘Please send a purchase order along with my registration. Request must be submitted at least four weeks in advance.’) {
if (elm.length > 0 && elm.find(‘tr’).length >= 1) {
arguments.IsValid = true;
} else {
arguments.IsValid = false;
}}}

I had some parenthesizes in my statement that I thought could be the culprit, but removing those did not work.  Hopefully someone sees what I'm messing up that I cannot see.  I'm horrible when it comes to JS so 99.9% I have no clue on what to troubleshoot when I have JS issues.  Any help here would be great. Thanks 


2 replies

Userlevel 2
Badge +9

Actually I found this thread  which solved my issue.  Specifically espradli@quiktrip.com;s section.  This worked exactly as I needed it.  

Badge +6

Happy to help. This community site has helped me a lot, so it is nice to know I have helped someone.

Reply