Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
    
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 at 15:58

2 Answers 2

up vote 2 down vote accepted

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 View 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.

share|improve this answer

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

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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