Disable all day event, Recurrence,Workspace Fields in Calendar list

Open the Newform.aspx in edit mode( <site>/Calendarlist/Newform.aspx?toolpaneview=2) and add the content editor webpart to below the form and paste the below script in html editor of the content editor web part.

<script type="text/javascript">
function HideField(title){
var header_h3=document.getElementsByTagName("h3") ;

for(var i = 0; i <header_h3.length; i++)
{
var el = header_h3[i];
var foundField ;
if(el.className=="ms-standardheader")
{
for(var j=0; j<el.childNodes.length; j++)
{
if(el.childNodes[j].innerHTML == title || el.childNodes[j].nodeValue == title)
{
var elRow = el.parentNode.parentNode ;
elRow.style.display = "none"; //and hide the row
foundField = true ;
break;
}
}
}
if(foundField)
break ;
}
}

HideField("All Day Event");
HideField("Recurrence") ;
HideField("Workspace") ;
</script>

if you want to hide more fields just you need to add field name in the function like HideField("FieldName");

Comments

Popular posts from this blog

SharePoint 2010: JavaScript Code To Check if user exists in a group (ECMA)

How to copy DLLs from GAC.