cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Remove Add attachment option in edit mode

Jump to solution

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.

Labels: (1)
Reply
13 Replies
Highlighted
Automation Master
Automation Master

Re: Remove Add attachment option in edit mode

Jump to solution

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.

View solution in original post

Reply
Highlighted
Nintex Newbie

Re: Remove Add attachment option in edit mode

Jump to solution

Hi Patrick

Thanks for your response. JS worked like a treat. Would you also be able to advise, if I can also hide the "delete" option.

Thanks

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Remove Add attachment option in edit mode

Jump to solution

Yes sir – you can do this as well once you know which CSS class to hook into... Here's the code needed to hide the delete button in tandem with the "add attachments" button while in edit 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();

    NWF$(".nf-default-attachment-control td.propertysheet").hide();

  }

});

The only way I could see to access the delete button was the .propertysheet class, but since that's likely not unique to the attachments control I made sure to look for td.propertysheet DOM objects within the .nf-default-attachment-control class to minimize the risk of impacting other controls.

Good luck Abhi Pathania!

Patrick .nf-default-attachment-control td.propertysheet

Reply
Highlighted
Nintex Newbie

Re: Remove Add attachment option in edit mode

Jump to solution

Perfect! Thanks a lot Patrick

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Remove Add attachment option in edit mode

Jump to solution

not a problem, happy to help!

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Remove Add attachment option in edit mode

Jump to solution

Hi Patrick

Not sure if you can help me with this as well. I am trying to hide Print to Pdf button from the tool bar. Any suggestions?

0 Kudos
Reply
Highlighted
Automation Master
Automation Master

Re: Remove Add attachment option in edit mode

Jump to solution

Good Morning Abhi Pathania​ – Off hand, I'm not sure of a good way. I provided Cassy Freeman​ with a similar ribbon altering solution​, but that was outside of Nintex on the SharePoint list itself. After investigating the CSS briefly, I'm not sure a similar solution could be leveraged.

I see Print to PDF configuration in Settings but these relate to size/orientation and not overall inclusion of the feature.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Remove Add attachment option in edit mode

Jump to solution

I agree, even I was unable to find anything in settings. Thanks anyway

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Remove Add attachment option in edit mode

Jump to solution

Hi Patrick,

Is there a way to show/hide some attachment control, I have 5 attachment control. I just need to remove the add attachment only for two.

Thanks,

Sojan

0 Kudos
Reply