I have a SP list that contains six Multiple line of text(Enhanced rich text) fields.
For 3 of the controls, I need to hide only the Upload File icon from the ribbon.
Any idea on how to achieve this?
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI have a SP list that contains six Multiple line of text(Enhanced rich text) fields.
For 3 of the controls, I need to hide only the Upload File icon from the ribbon.
Any idea on how to achieve this?
Add this below code to Script Editor Webpart
<script type='text/javascript'>
document.getElementById('Ribbon.ListForm.Edit.Actions').style.display= 'none';
</script>
There is a similar question here:
SP 2013 - Disable Upload in Enhanced RichTextField
Not sure if there are other ways, but one way is to hide it through CSS,
#Ribbon\.EditingTools\.CPInsert\.Links\.UploadFile-Large
{
display:none !important;
}
Now, as for showing it and hiding it depending on the context, you can do that using a JavaScript event handler, maybe using the css match above.
rough example:
if(mydiv).click{
$("#Ribbon\.EditingTools\.CPInsert\.Links\.UploadFile-Large").hide();
}
if(myotherdiv).click{
$("#Ribbon\.EditingTools\.CPInsert\.Links\.UploadFile-Large").show();
}