Skip to main content

How to hide recurrence fields from Calender list using javascript


Put following code in the content Editor webpart of EditForm.aspx, NewForm.aspx and DispForm.aspx to hide "All Day Event, Recurrence and Workspace columns "



/*
  Detail: This code is to hide all three fields - 'All Day Event','Recurrence','Workspace' from the form
*/
_spBodyOnLoadFunctionNames.push("hideall()");
function hideall()
{
HideField("All Day Event");
HideField("Recurrence");
HideField("Workspace");
HideField("Is Active");
}
function HideField(title){
var header_h3=document.getElementsByTagName("h3") ;
for(var i = 0; i {
    var el = header_h3[i];
    var foundField ;
   if(el.className=="ms-standardheader")
    {
        for(var j=0; 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 ;
}
}

Comments

Popular posts from this blog

Publishing SharePoint List InfoPath Form to a new location

Needed to move it from Dev to Production. File > Publish > Export Source Files. Close InfoPath Go to folder where Source Files are saved, open Manifest.xsf.  Find all instances of the URL and replace them with the new URL - there should be five. If you have secondary data connections, update those also. I use Notepad++ and “replace all” so it just takes a second.  Save the manifest.xsf file and close. Now right click on the manifest.xsf and select Design to open it back up in InfoPath.  Click on File >Publish and verify the URL is correct in the “Publish form to a SharePoint List” section”.