Add the below lines where you want like Dispform or EditItemfrom.
Below this PlaceHolderMain
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
**********Start***********
<script 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("Now");
control.parentNode.parentNode.style.display="none";
control = findacontrol("MilestoneId");
control.parentNode.parentNode.style.display="none";
}
</script>
Below this PlaceHolderMain
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
**********Start***********
<script 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("Now");
control.parentNode.parentNode.style.display="none";
control = findacontrol("MilestoneId");
control.parentNode.parentNode.style.display="none";
}
</script>
**********End***********
No comments:
Post a Comment