Question

I have a forms library with a few Infopath forms in them. I want to make it so that clicking on the form will open it in a new window/tab. I have added a CEWP with Javascript to give the hyperlinks the target blank attribute, but they still continue to open in the same window.

<script type="text/javascript">
$(document).ready(function(){
    $('#onetidDoclibViewTbl0 a').attr('target', '_blank');}
);
</script>
Was it helpful?

Solution

Never mind I figured it out. There was an onclick function for the hyperlinks that was causing it to open in the same window. I followed the instructions from this post and fixed it.

Opening a document in a SharePoint 2013 document library in a new tab (using code)

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top