Just wondering if there is way to remove the Add Attachment option from attachment control in edit mode. I have tried disabling the control but that also, removes the option to view the attachments. I am just wanted to remove option to add more attachments once form has been submitted.
Remove Add attachment option in edit mode
Best answer by patrickabel
Hello Abhi Pathania,
I just built a sample form to test out the attachments control and don't see an OOTB means of accomplishing what you're needing. However, you can control the presence of the "add attachments" button through CSS. Here's a quick example on how you could do this:
.nf-attachmentsLink {
display: none !important;
}
Building upon this proof-of-concept, you could instead use some JavaScript which checks to see if you're in "edit mode" and then changes the display of that "add attachments" button conditionally. With the below code, you can now remove the ability for additional attachments to be added when in edit mode without impacting the behavior of the control while in new/display mode.
NWF$().ready(function() {
// if the form is in edit mode (mode=1)
if (window.location.href.indexOf("mode=1") !== -1) {
// Hide the "add attachments" aspect of the attachments control
NWF$(".nf-attachmentsLink").hide();
}
});
Good luck Abhi Pathania!
Patrick
FYI, I believe there's several ways to determine what mode your form is in but I went this route since I built my test in an O365 environment.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.