If you have several SharePoint Forms, where you want to hide the input field and using SharePoint Designer to create a custom form is not an option. Here is my collection of jQuery you can insert, using the ScriptEditor webpart.
Edit the “view” of a ListItem (DispForm.aspx)
- Open an element on the list, thus letting you view the DispForm.aspx page
- Edit the page (not the content)
- Insert the Scripteditor webpart
- Insert this code in the webpart and remember to edit the “SPBookmark_CaseID” to “SPBookmark_” + whatever name your field has
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.0.min.js"></script><script type="text/javascript" language="javascript">// <![CDATA[$(function() { $('a[name=SPBookmark_CaseID]').parent().parent().parent().hide();});// ]]></script>
Edit the “new” and “edit” of a ListItem (NewItem.aspx and EditItem.aspx)
It is the same jQuery code that goes for the new item page and the edit item page.
- Edit a ListElement, thus letting you view the EditForm.aspx page or
- Add a Listelement, thus letting you view the NewForm.aspx page
- Edit the page (not the content)
- Add the Scripteditor webpart
- Insert the code in the webpart and remember to edit the “CaseID” to whatever name your input field has
<script type="text/javascript" src="https://getinthesky.sharepoint.com/SiteAssets/Scripts/jquery-2.1.0.min.js"></script><script type="text/javascript" language="javascript">// <![CDATA[$(function() { $('input[title=CaseID]').parent().parent().parent().hide();});// ]]></script>
Leave a Reply