Hide Columns in NewForm.aspx / EditForm.aspx / DispForm.aspx
Hide SharePoint Columns in New / Edit / View Form
Open the SharePoint Designer 2010, Go to the Corresponding List/ Library.
Open the New/Edit / View Item Aspx Page in Edit In Advance Mode add the Following script
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
Now copy & paste this JavaScript code after above mentioned tag :
Open the SharePoint Designer 2010, Go to the Corresponding List/ Library.
Open the New/Edit / View Item Aspx Page in Edit In Advance Mode add the Following script
<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
Now copy & paste this JavaScript code after above mentioned tag :
<script language="javascript" type="text/javascript"> _spBodyOnLoadFunctionNames.push("hideFields"); function findacontrol(FieldName) { var arr = document.getElementsByTagName("!"); // get all comments for (var i=0;i < arr.length; i++ ) { // now match the field name if (arr[i].innerHTML.indexOf(FieldName) > 0) { return arr[i]; } } } function hideFields() { var control = findacontrol("Title"); control.parentNode.parentNode.style.display="none"; control = findacontrol("Document Link"); control.parentNode.parentNode.style.display="none"; control = findacontrol("PublishDate"); control.parentNode.parentNode.style.display="none"; } </script>
Comments
Thanks a lot...
But If you could add, where to add this script tag, then it would save time of the novice users like me..:)
Thanks a lot, again!!
Just copy & paste this JavaScript code after this tag :
You must open your page in "Edit File In Advanced Mode" option.
and not the one you have mentioned above