I am trying to hide OOTB attachment from listviewform and edit form in my SharePoint 2013 list . I used sharepoint manager tool 2013 to hide it . its working fine for other fields for me like title, body etc but for this attachment the changes are not getting reflected . is there something wrong with the tool , if you guys know any other way around for this .and i dont want to use javascript . if you guys know any other tool for this . pls let me know. thanks in advance
-
What are you trying to do? Disable attachments for that List? Did you really use SharePoint Manager to customize the View- and EditForm? Or did you use SharePoint Designer?– NilsFeb 24, 2016 at 6:47
-
see i dont want attachment field to show in the 'displayform.aspx' and 'editform.aspx' , it should only be visible in the 'newform' . and i used SharePoint manager tool not the designer . as sharepoint manager tool has the options to hide or show the list columns in different forms.– Revenant_01Feb 24, 2016 at 6:50
-
so i hid other fields like 'body' from the displayform using that tool , but when i do the same thing for attachment it still show up– Revenant_01Feb 24, 2016 at 6:51
-
1Attachment is kind of 'special'.. I never tried hiding fields using SharePoint Manager... Have you tried the option in th UI: Ribbon -> Settings menu -> List Settings -> Advanced settings -> Attachments? There should be an option to (not) add the attachments to default views...– NilsFeb 24, 2016 at 6:57
-
i dint try that one . let me try– Revenant_01Feb 24, 2016 at 6:59
2 Answers
I see the following options:
- Use JavaScript in the Edit-/DisplayForm to hide the button.
- A CustomAction to remove the Button Completely, then add a new one which only appears in the NewForm. (Also JavaScript in this soltution)
- Add custom Edit- & DisplayForms (not sure if this works, tough)
- Develop & depoly a WebPart, use SPRibbon.TrimById to remove the attachments-button from the ribbon, add the WebPart to the Edit-&DisplayForm
well i had to do it through css on displayform
#idAttachmentsRow{display:none !important;}
as no other options was there for me and my EditForm was custom so i just kicked that attachment field from it.