When we add lookup column to any SharePoint list, it appears with the link to parent item in SharePoint list views. Quite often, end-user clicks on the lookup link and edits parent lookup item by mistake - People get confused which link to click. So we wanted to remove hyperlink from lookup columns in SharePoint 2013 list views.
Here is how you can remove hyperlink from lookup fields out-of-the-box without any coding and customization efforts.
- Go to your list settings, Pick the lookup column. In my case its "Parent Project". In "Edit Column" page, Select "Title" field under "Add a column to show each of these additional fields" Section as highlighted below.
- Now, Edit your list view, Unselect "Parent Project" field and select "Parent Project: Title" field. (You can rename this Title - BTW!)
Click "OK" to save the view. That's all! This removes the link from hyperlink columns.
Using JQuery to remove hyperlink from lookup column:
Lookup columns are pointing to.link something like "http://Site/***&RootFolder=*". So, lets find all Anchor elements of the page with href attributes "&RootFolder=*". and remove remove link of the lookup.
To remove lookup hyperlink from SharePoint list view using jQuery, Follow these steps:
- Go to your List view page, E.g. http://portal.crescent.com/Lists/ProjectMilestones/AllItems.aspx
- Click on Site Settings gear, Click on "Edit Page" Menu item
- Click on Add a Web Part link shown on the page, Under "Media and Content" choose "Script Editor" and Click on "Add" Button
- Click on "Edit Snippet" link on the Script Editor Web part and place the below code in it.
- Save and Close the page!
You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.