Hey guys,
I published an InfoPath browser form and have it displayed in an InfoPath Form Web Part on a SharePoint 2010 page. The form has a bunch of hyperlinks which by default InfoPath opens in a new window, but I added the code below in a CEWP on the SharePoint page so that all links open in the same window (target = "_self"). My question is, how do I modify the code so that I can choose which links open in the same window, for example I want some links to continue opening in a new window because they are external URLs, while I want URLs to other pages on the SharePoint site to open in the same window, so I need more dynamic code that lets me set only the hyperlinks I choose to open in the same window. Thanks in advance for your help!
Code:
_spBodyOnLoadFunctionNames.push("rewriteLinks");
function rewriteLinks() {
var links = document.getElementsByTagName('a');
var len = links.length;
for(var i=0; i[less than symbol]len; i++)
{links[i].target = "_self";}}