I want only some columns to be displayed when I click on edit items option. It should be a customized form having only few columns to be edited. Is there any way to do it?
2 Answers
You have more options other than the jQuery hack:
Option 1: custom edit form
Create a new EditForm in SharePoint designer and set it as default. To do this, in SPD go to your list, then Forms > New > Edit item form > set as default form. You can then customize the form and delete from the generated xslt/html code the fields you don't want to be editable.
Option 2: content type management / hide columns
Enable content types management. Using the browser UI, go to List settings > Advanced Settings > Allow management of content types > yes > OK. Then, under content types, click on the content type (eg. Item), and click on each column you don't want to be editable, then set Hidden (Will not appear in forms). Caveat: hidden columns won't appear in the newform either
-
I want all columns to be displayed in newform. I want only some columns to be displayed in edit item option.– RamCommented Mar 11, 2014 at 6:54
-
You need to set the ShowInEditForm
field property to false
in order for a field to be not shown in the Edit Form.
UPDATE
ShowInEditForm
property is not available through UI while creating a column. If you are restricted to creating columns through UI only, then you may have to hide columns through JQuery/Javascript
Place a content editor webpart or script editor webpart (2013) in the Edit form and use this script as an example to hide a field:
<script src="http://sp2010:90/JQuery/jquery-1.7.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
var locationField = $("input[title=Location]");
locationField.parent().parent().parent().hide();
</script>
As can be seen the script needs JQuery to be placed in a library
-
-
How are you creating the field. In XML file, Programatically?? Through UI using content type or simply adding columns Commented Mar 10, 2014 at 12:04
-
-
This property is not available through UI while creating a column. If you are restricted to creating columns through UI only, then you may have to hide columns through JQuery/Javascript Commented Mar 10, 2014 at 12:09
-
1I would recommend against using the title property as a jQuery selector, as it may change if you switch to a different language in a multi-language site Commented Mar 10, 2014 at 21:48