Lookup links open in new tabs

Home Forums General discussion Lookup links open in new tabs

Viewing 4 reply threads
  • Author
    Posts
    • #31672
      Mark Bassig
      Participant

        Hi Alex,

        I was wondering if you can advise/suggest what to do here. In SharePoint List A, the lookup column appears as link to an item from SharePoint List B. When I click on the lookup link from SharePoint List A, I would like the link to open in a new tab.

        I tried a number of ways however did not work.

        Thank you in advance.

        Mark

      • #31681
        Alexander Bautz
        Keymaster

          Hi,
          Is this in a list view or in your display form?

          Alexander

        • #31686
          Mark Bassig
          Participant

            This is in a display form with tabs.

          • #31688
            Alexander Bautz
            Keymaster

              You can add this to your Custom JS to force all anchor tags to open in a new tab:

              jQuery(".ms-formbody").on("mouseover","a",function(){
                  jQuery(this).attr("target","_blank");
              });

              If you only want to target one specific field you can change it like this:

              jQuery("#dffs_YOUR_FIELD_INTERNAL_NAME_HERE").on("mouseover","a",function(){
                  jQuery(this).attr("target","_blank");
              });

              Alexander

            • #31690
              Mark Bassig
              Participant

                Thank you. Much appreciated.

            Viewing 4 reply threads
            • You must be logged in to reply to this topic.