How to make the Title Field link open in new window
Posted by davidnarramore - Feb 19 ’15 at 03:40
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
-
Dmitry KozlovAdminMember for: 9 years 8 months 7 days
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:
fd.field('FileLeafRef').control()._el().find('a') .attr('target', '_blank') .attr('onclick', '');
-
davidnarramoreMemberMember for: 8 years 4 months 7 days
Thank you Dimitri. Where do I put it? I'm not a developer.
D.
-
Dmitry KozlovAdminMember for: 9 years 8 months 7 days
[#2]: 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.