Alternative Solution
If you want hide any field from NEW/VIEW/EDIT item Forms. Then you can simply achieve this using SPUtility.js, Its very simple and useful. You can download js file from sputility
Steps:
- Edit NEW/VIEW/EDIT item form in SharePoint UI.
- Add Script editor web part.
Add the following script in Script editor web part.
<script src="/jquery.min.js" type="text/javascript"></script>
<script src="/sputility.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
SPUtility.HideSPField('FieldNameToHide');
});
</script>
Ok & Save the page.
Now specified field will not be visible.
If you want to Show that field again then you can use,
<script src="/jquery.min.js" type="text/javascript"></script>
<script src="/sputility.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
SPUtility.ShowSPField('FieldNameToShow');
});
</script>
SPUtility.js is a JavaScript library used to make modifications to SharePoint's list forms (NewForm.aspx, DispForm and EditForm.aspx in a survey, custom list or library). It works with SharePoint 2007, 2010, and 2013 (including SharePoint Online / Office 365).
SPUtility.js Documentation