3

How can we remove hyperlink from a multi value look up column in SharePoint 2010 list. There are article on removing hyperlink from Single Value look up column. But I am not able to get a way to remove hyperlink from a multi value look up column. Anyone having any idea please help.

I have used xsl in sharepoint designer. Below is the code <xsl:value-of select=”substring-before(substring-after($thisNode/@*[name()=current()/@Name],’&‌​gt;’), ‘&lt;’)” disable-output-escaping=”yes”> This works fine for Single value lookup column but fails for multi value look up column

  • How do you try? Show code – Atish Dipongkor - MVP Sep 23 '15 at 11:03
  • I have used xsl in sharepoint designer. Below is the code <xsl:value-of select=”substring-before(substring-after($thisNode/@*[name()=current()/@Name],’&gt;’), ‘&lt;’)” disable-output-escaping=”yes”> This works fine for Single value lookup column but fails for multi value look up column. – SushriSmita Rout Sep 23 '15 at 11:08
  • update your question – Atish Dipongkor - MVP Sep 23 '15 at 11:16
0

You could create a Designer Workflow, which copies the value of the lookup column into a new column as string.

Lookup column (with links):

value1; value2

Target column:

value1,value2

The target column could be hidden to the user in the form (by not adding it to a content type), but displayed in the list view. So users will interact with the lookup column, but only see the target column in the view.

0

Great start in the SharePoint display form. Best to strip the HTML links from the escaped output using jQuery. In my case I have a multi-value lookup column called "Clients" with several clients selected.

First wrap the escaped output in a DIV tag with an appropriate id:

<div id="lstClients">
     <xsl:value-of select="@Clients" disable-output-escaping="yes"/>
</div>

I'm using a content editor web part to include my JavaScript code.

You can start with:

$(document).ready(function () {
        ExecuteOrDelayUntilScriptLoaded(ExecuteAfterLoad,'SP.js') ;
    });

function ExecuteAfterLoad(){
        removeLinks($("#lstClients"));// Pass the DIV tag object to the function
    }

function removeLinks(obj){
      return obj.html(obj[0].innerText);
    }

If you examine the DIV tag object, you will discover that the zeroth child element has an innerText value that already contains the text that you want without the link code!

Simply replace the HTML within the DIV tag with the text! No parsing!! No looping!! It just works!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.