I created a new edit form for a sharepoint 2010 list. Two of the fields on the form (Funding Approval and Funding Code) need to be displayed as read only for everyone except two users. When either of these two users logs on and opens the same form, those 2 fields need to be in the "Edit" mode since they are the ones that have the responsibility of Approving the items in the list and adding the funding code. Does anyone know how to accomplish this?
Asked
Active
Viewed 826 times
2 Answers
0
I answered a very similar question here, whcih should have all the information you need. In that particular case, it was looking for group members but it could just as easily look for a user account or two.

Community
- 1
- 1

Paul Leigh
- 1,231
- 7
- 7
0
Assuming these fiels are text fields, using whatever language you're coding in, just add the attribute disabled="disabled"
when these users access the page. E.g. <input name="funding_approval" disabled="disabled" type="text" />
. That will disable changing the fields.

j08691
- 204,283
- 31
- 260
- 272
-
1If you disable the fields, the form won't post. You should hide them or else additionally intercept the PreSaveAction to re-enable them before posting the form. – Paul Leigh Jan 19 '12 at 16:08
-
If they're not being changed, why do they need to? – j08691 Jan 19 '12 at 16:10
-
1SharePoint Requirement, all fields need to be present in the form post - disabled controls are not in the collection so it will fail. This an edit, so it's perfectly valid to post an empty value to clear a previous value. – Paul Leigh Jan 19 '12 at 16:13