Hi,
I suggest to use javascript code to block the edit modal dialog when uploading file.
We can use SharePoint Designer 2013 to open the EditForm.aspx of the specific document library, add the code snippet below under the tag <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">:
<script type="text/javascript"> function GetQueryStringArgs(){ //fetch querystring and remove first ? var qs=(location.search.length>0?location .search.substring(1):""); //create an object for saving data var args={}; var items=qs.split("&"); var item=null, name=null, value=null; //add to args object one by one for(var i=0;i<items.length;i++){ item=items[i].split("="); name=decodeURIComponent (item [0]); value =decodeURIComponent (item[1]); args[name]=value ; } return args ; } var args=GetQueryStringArgs(); var urlReferrer=document .referrer .toString (); if(urlReferrer .indexOf ("Upload")!=-1){ window.frameElement.commitPopup(); }</script>
Then save the EditForm.aspx and refresh the site page in browser to check the result.
best regards
- Marked as answer by Jennifer Higbie Thursday, August 29, 2013 3:22 PM
Hi,
I suggest to use javascript code to block the edit modal dialog when uploading file.
We can use SharePoint Designer 2013 to open the EditForm.aspx of the specific document library, add the code snippet below under the tag <asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">:
<script type="text/javascript"> function GetQueryStringArgs(){ //fetch querystring and remove first ? var qs=(location.search.length>0?location .search.substring(1):""); //create an object for saving data var args={}; var items=qs.split("&"); var item=null, name=null, value=null; //add to args object one by one for(var i=0;i<items.length;i++){ item=items[i].split("="); name=decodeURIComponent (item [0]); value =decodeURIComponent (item[1]); args[name]=value ; } return args ; } var args=GetQueryStringArgs(); var urlReferrer=document .referrer .toString (); if(urlReferrer .indexOf ("Upload")!=-1){ window.frameElement.commitPopup(); }</script>
Then save the EditForm.aspx and refresh the site page in browser to check the result.
best regards
- Marked as answer by Jennifer Higbie Thursday, August 29, 2013 3:22 PM
- Proposed as answer by 2mp Tuesday, September 24, 2013 11:08 PM
- Proposed as answer by 2mp Tuesday, September 24, 2013 11:08 PM
That's for the solution, worked for me. It is worth noting that the code you supplied doesn't actually use the function GetQueryStringArgs. So all you need is this chunck
var urlReferrer=document.referrer.toString(); if(urlReferrer.indexOf("Upload")!=-1) { window.frameElement.commitPopup(); }