How to make the Title Field link open in new window

Discussions about Forms Designer for SharePoint 2010.
Locked
davidnarramore
Posts: 76
Joined: Wed Jan 21, 2015

19 Feb 2015

I have a requirement to have the "Title" field link from the Document Library open in a new window instead of the current tab. I have copied links from other libraries into enhanced rich textboxes and they open in a new tab. I have modified the XSLT to include the target="_blank" and it works from the library, I want to open the document without leaving the display or edit forms.


David

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

20 Feb 2015

Hello David,

As I understood, you want to open a link from the Name field in a new window, am I right? If so, please, insert the following code in Display and Edit forms:

Code: Select all

fd.field('FileLeafRef').control()._el().find('a')
	.attr('target', '_blank')
	.attr('onclick', '');

davidnarramore
Posts: 76
Joined: Wed Jan 21, 2015

20 Feb 2015

Thank you Dimitri. Where do I put it? I'm not a developer.


D.

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

20 Feb 2015

Open the display form in Forms Designer, click JS button on the ribbon and insert the code from my previous message into the dialog. Next, save the form and repeat the steps for the edit form.

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests