0

i am trying to hide the hyperlink that allows people to upload files using windows explorer in Upload.aspx modal window which appears when trying to upload a new document to the Shared Documents library. But i am unable to select the element for the hyperlink which displays "Upload files using Windows Explorer instead". The id of that anchor tag element is ctl00_PlaceHolderMain_UploadDocumentSection_ctl01_OpenWithExplorerLink

So when i try this in the Console tab in F12 developer tools in IE11-

document.querySelectorAll("#ctl00_PlaceHolderMain_UploadDocumentSection_ctl01_OpenWithExplorerLink")

I get -

<NodeList length="0"></NodeList>

SharePoint Upload.aspx modal window

Community
  • 1
  • 1
vivek m
  • 117
  • 1
  • 2
  • 15
  • You're probably seeing an – SLaks Mar 08 '16 at 21:50
  • you could be right, the Upload.aspx maybe within an IFrame. is no way to manipulate the css of elements within an – vivek m Mar 08 '16 at 21:55
  • Can you please include any relevant markup? See http://stackoverflow.com/help/how-to-ask Thanks! – Ted Whitehead Mar 08 '16 at 21:55
  • It is possible to communicate with an iframe if you control the code in the iframe. See http://stackoverflow.com/questions/251420/invoking-javascript-code-in-an-iframe-from-the-parent-page – Ted Whitehead Mar 08 '16 at 21:56
  • i checked the markup , the upload seems like it is within an IFrame. The upload.aspx is a out of the box sharepoint code and I cannot modify that unfortunately. But i somehow need to hide that hyperlink so that people cannot use Windows Explorer to upload documents. Ted - thanks for your response, I am trying to upload some markup but it is proving to be difficult as it is lot of lines of code and sharepoint is not being nice with the View Source on the modal window, – vivek m Mar 08 '16 at 22:17

1 Answers1

0

It's inside an <iframe> but that iframe still references your CSS file (i.e. via Site settings > Master Page > Alternate CSS URL)

Then you can target with:

a[id*="_OpenWithExplorerLink"] {
    display: none;
}
Francis Nepomuceno
  • 4,935
  • 4
  • 29
  • 35
  • i will mark this as answer because the above will hide the openwithexplorer hyperlink. I am still intrigued about how to select an element and change its css within an Iframe. If i am able to figure that out i will post it here. Thanks Neps. – vivek m Mar 11 '16 at 18:39