• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1911
  • Last Modified:

How to Disable Onclick event for SharePoint Month Calendar item?


How to Disable Onclick event for SharePoint Month Calendar item? using java script or CSS ...

Thanks,
Venkateswara Rao P
0
PillalamarriVenkateswaraRao
Asked:
PillalamarriVenkateswaraRao
1 Solution
 
PillalamarriVenkateswaraRaoAuthor Commented:
Got the solution. By using below lines of code ...

Anybody wants clear idea on this please see the below url.

http://www.sharepointdev.net/sharepoint--design-customization/calendar-view-edit-item-links-1757.shtml

Thanks,
Rao.


<script>

function DisableLinks()
{
 var x = document.getElementsByTagName("A");
 for (var i=0;i<x.length;i++)
 {
  if (x[i].href.indexOf("DispForm.aspx")>-1)
  {
    x[i].onclick = function () {return false};
    x[i].href="javascript:return false";
    if (x[i].parentNode.href) 
    {
      x[i].parentNode.onclick = function () {return false};
      x[i].parentNode.href="javascript:return false";
    }
  }
 }
}

// add our function to the SharePoint OnLoad event
_spBodyOnLoadFunctionNames.push("DisableLinks"); 

</script>

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now