1

I want to make certain field like 'Status' read only mode. Say, if user with contribute access login and edit item, open 'editform.aspx' , the status field need to be 'readonly' but if user with full control open same list item in edit mode then status field is editable. I do not want to use infopath , can i achieve same using SPD2010?

  • You cannot do it as described changing the controlmode to View, you get an error when trying to view the form. SharePoint 2010 Not sure if you need to add the security changes for it to work but I agree that this answer is really not concise/detailed enough to help at this point – user21623 Apr 14 '14 at 15:58
3

Yes you can achieve this using SPD2010. Follow the below steps:

  1. Create a custom edit form for your list in SPD 2010. Go to "Lists and Libraries". Select your list. In Forms tab (on right side) click on "New" and create custom edit form.
  2. Now edit the form in advanced mode.
  3. There you will find every column of your list present in table structure. For example:

<tr>

<td width="190px" valign="top" class="ms-formlabel">

<H3 class="ms-standardheader">

<nobr>Titel</nobr>

</H3>

</td>

<td width="400px" valign="top" class="ms-formbody">

<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Title" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}"/>

<SharePoint:FieldDescription runat="server" id="ff1description{$Pos}" FieldName="Title" ControlMode="Edit"/>

</td>

</tr>

Notice the SharePoint:FormField and SharePoint:FieldDescription tags. If you change ControlMode to Display instead of Edit in both of the tags, that field will come as readonly in the form.

For permission, you can use SPSecurityTrimmedControl class. For complete list of permission strings check this link.

So basically, you can create a permission mask using SPSecurityTrimmedControl in your custom form and then display the column in edit or view mode by changing its ControlMode property. Hope this helps.

  • 1
    Suggesting improvement on the above solution ControlMode is accepting Display rather View – user851316 Nov 27 '14 at 8:49
-1

Alternatively, you could also use jQuery. It would need to incorporate a Content Editor Webpart and SPServices.js

  • Please extend this answer to make it more helpful. How can you do what you propose, code examples and links is always helpful :) – Robert Lindgren Dec 4 '13 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.