Read Only column(s) on the EditForm.aspx
Stunpals asked the question "How do you have fields show up as "read-only" in the EditForm.aspx for a list? in 12/2010. DavidLewis27 proposed the solution that Stunpals used of adding the following code: <SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Title"> This worked for Stunpals but I am unclear where to add this line of code to the file. Also, for mulitple fields, is this line repeated, or can it be modified to inlcude multiple Fieldnames using pipes or ? I use SPD for workflows, etc but I have very limited coding experience. Thank you in advance.
April 22nd, 2011 7:06pm

Hello, In designer, if you navigate into your list on the left side you will find all the forms, open the EditForm.aspx and make sure you edit it in "Advanced Mode" which can be found on the top right corner of the designer menu ribbon. Search for the required field and you will find it. Hope the information helps, please do let us know the outcomeThanks & Regards, Chandra Shekhar Rameneni
Free Windows Admin Tool Kit Click here and download it now
April 23rd, 2011 7:47am

Chandra - Thank you for your response. I am working in SPD 2007, so I don't have an option for editing in advanced mode. However, from a brief search on the web, I think when I choose to opent the EditForm.aspx with an editor (I use Crimson Editor) that should work the same. When viewing the .aspx file with the editor, I do not see any of the column names listed individually. Am I missing something? R/ Alex
April 25th, 2011 4:25pm

No you're not missing anything. The page will typically open the page layout and not the content. I don't think you'll need it though. I've only had a quick look at the thread but looking at the code you've posted, just edit the segment of the code below to include the static name of the column you want to change to read only. I've quoted some text below from Marc Anderson that explains how to locate the static name of your column. "StaticName (as opposed to DisplayName) means the underlying column name, e.g., Region_x0020_Name. This is also sometimes called the 'internal name' for the column. The DisplayName would be Region Name, i.e., the name of the column which is shown on forms and as the header in list views. Probably the easiest way to determine the StaticName if you don't know it is to go to List Settings and click on the column name link. When you get to the column properties page, check the URL. It will end in something like this: /_layouts/FldEdit.aspx?List=%7B37920121%2D19B2%2D4C77%2D92FF%2D8B3E07853114%7D&Field=Potential%5Fx0020%5FValue The StaticName is the value for the Field parameter at the end. This is a little tricky because some of the characters are further encoded. Any occurrences of '%5F' need to be replaced with an underscore '_'. Examples: * Potential%5Fx0020%5FValue -> Potential_x0020_Value * Child%5Fx0020%5FSite%5Fx0020%5FName -> Child_x0020_Site_x0020_Name" FieldName="StaticName">Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
April 26th, 2011 8:28am

All, I am still not finding it. My goal is to have all fields editable, but the 2nd field "Purpose" as read-only. From looking at the EditForm.aspx, it looks like the file has a template for how the fields are displayed that is repeated for each of the columns in the list, but I can't figure out where to insert the code. Please take a look at my file and see if you can tell me where the code fits in. https://docs.google.com/leaf?id=0B-bAzy74L-TRYjA3MTZjMzUtMjkyYS00NTBkLTkyMGEtYTA1YjI0ZDIwODU1&sort=name&layout=list&num=50 The file consists of 1) content editor web part with some text, 2)the list display web part where I am trying to modify how the columns are displayed, and 3) a second content editor web part with some java script to hide some of the columns. (Note: Could I accomplish the same thing (make column display only) by adding to the java script in the second content editor web part?) Your assitance is appreciated. R/ Alex
April 27th, 2011 2:13pm

Do you know how to make a list template? I'd like to work with what you have to see if I can make this work. Can you generate an stp and send it to me at baron_72@hotmail.com and I'll take a look for you, with a view of posting a solution here for the community.Steven Andrews | SharePoint Professional | http://www.twitter.com/backpackerd00d | https://baron72.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2011 10:26am

Hi Alex, If you are unable to find the code that you seek, you may not be looking at a customized editform.aspx page. In order to find the field you need, using SharePoint designer 2007 you can: Create a copy of your original EditForm.aspx Open the Copy of your original and right click on the default ListFormWebPart and select web part properties. Expand + Layout and make sure the 'Hidden' check box is checked. Add a Custom list form by clicking 'Insert > SharePoint Controls > Custom List Form' Select the appropriate Document Library, Content type and type of form (in your case Edit item form) and click OK Make sure you are in 'SPLIT' view and then in the design window, click on the text box that you want to be read only. The corresponding code will be highlighted in the code window. Find the portion of the code that says ControlMode="Edit" and change it to ControlMode="Display" This will convert the field to Read Only for this form. - Xenox G.
April 28th, 2011 3:48pm

Thank you Xenox. This worked best for me. I was able to select the field in the custom list webpart and change the display in the "Tag Properties" window on the left side. The less actual coding the better for me, but now that the .aspx is in this format the orginal code-based solution would work as well. Maybe I missed that step on the previous string I quoted. One thing that needs to be done after this customization and is explained elsewhere is to assign your newly customized .aspx file as the appropriate default (NewForm, DisplayForm, EditForm) form in the "Supporting Files" definition for your list. I appreciate everyone's input into figuring this out. R/ Alex
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2011 6:37pm

Thank you Xenox. This worked best for me. I was able to select the field in the custom list webpart and change the display in the "Tag Properties" window on the left side. The less actual coding the better for me, but now that the .aspx is in this format the orginal code-based solution would work as well. Maybe I missed that step on the previous string I quoted. One thing that needs to be done after this customization and is explained elsewhere is to assign your newly customized .aspx file as the appropriate default (NewForm, DisplayForm, EditForm) form in the "Supporting Files" definition for your list. I appreciate everyone's input into figuring this out. R/ Alex
April 28th, 2011 6:37pm

Thank you Xenox. This worked best for me. I was able to select the field in the custom list webpart and change the display in the "Tag Properties" window on the left side. The less actual coding the better for me, but now that the .aspx is in this format the orginal code-based solution would work as well. Maybe I missed that step on the previous string I quoted. R/ Alex
Free Windows Admin Tool Kit Click here and download it now
April 28th, 2011 6:37pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics