2

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?

1

Add this below code to Script Editor Webpart

 <script type='text/javascript'>
document.getElementById('Ribbon.ListForm.Edit.Actions').style.display= 'none';
</script>
0

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.

e.g. https://stackoverflow.com/questions/4660633/detect-click-inside-outside-of-element-with-single-event-handler

rough example:

if(mydiv).click{
 $("#Ribbon\.EditingTools\.CPInsert\.Links\.UploadFile-Large").hide();
}
if(myotherdiv).click{
 $("#Ribbon\.EditingTools\.CPInsert\.Links\.UploadFile-Large").show();
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.