Choose which links in InfoPath Form Web Part open in same window - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Choose which links in InfoPath Form Web Part open in same window

Last post 01-07-2018 01:42 PM by qRules is qool. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 01-07-2018 01:42 PM

    Choose which links in InfoPath Form Web Part open in same window

    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";}}
Page 1 of 1 (1 items)
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.