I did manage to get this working using a mixture of other posts and muddling through it.
Step 1. Put this function in the custom JavaScript section in the Settings window.
function getNumberOfAttachments(attCtrlClassName){
return NWF.FormFiller.Attachments.GetAttachedFilesCount(NWF.FormFiller.Functions.GetFillerDivObjectForControl(NWF$("#"+NWF$("." + attCtrlClassName + " .nf-attachmentsRow")[0].id)).data("controlid"));
}
2. Then on the attachments control, I put in a validation rule that looks at two fields and checks if either (or) has matched a specific value for each:
The above condition checks if field:DepartmentsInvolved is more than or equal to 2 or if field:TotalProjectTeam2 is greater than or equal to 5.
Apologies for not crediting the other posts but it was a mish mash of multiple browser tabs and a few nights sleep since then 🙂
Thanks for all the support on this.
I hope this helps someone else. Basically, you can reuse that JavaScript as it is and then assign a rule to the attachments control to check for field values.