Difference between ReadOnly and Hidden in EditForm?

Jun 1, 2010 at 7:12 PM

When I set a field to ReadOnly and try to edit an item in the list the field isn't displayed.  I expected it to be displayed but uneditable.  Is this behavior by design?

Harv

Coordinator
Jun 1, 2010 at 7:18 PM

This is by design. SharePoint will not display a field that is marked as Read Only Or Hidden. By default SharePoint can't create a control for you that is read only. If you want to modify that in your form, you can always create a read only control in a customized SharePoint List Form which you manage directly using SharePoint Designer. I would, if you need to do this, create a new ASPX page, place a custom form on it, implement your read only field, then set that as your default edit or new form. That way you now have two forms. One that will have a read only field and one that has a writeable field. Lot's of options. I hope this helps, if not please let me know and I will try to help in anyway possible.

Jun 1, 2010 at 7:31 PM

We already have a solution but were hoping this would be a more easily managed solution.  Our current solution is java code that runs in Content Editor on each list and modifies the fields on the fly.  Since we require some fields to be dislayed to the user in Edit mode but remain uneditable this won't work. 

Still, it's a wonderful piece of code and, except for this one gotcha, is a easy way to modify field properties.

Harv

Nov 21, 2012 at 10:23 PM

Java code in a CEWP? Hmmm...

If you're looking for a solution to lock fields for editing in EditForm pages your best bet is to add some basic JavaScript to the page via a CEWP.

This solution is all about setting a field's properties. The danger here is that some of these fields should absolutely NOT be modified, especially by the uninformed.