2

In SharePoint Designer 2010 how can I mark a field (Multi Line Text) as read only... I still want a scrollable box but do not want the field to be editiable

3

I don't remember trying these on multi-line text fields, but each should be worth trying.


SharePoint Designer

In SP2013 or newer you can't do it with SharePoint Designer's default tools.

However, if you are using an older version of SP, this should be doable with SPD. The steps include creating a new Edit Form and editing it so that you set a property Display for the field's default value Edit on ControlMode.

This has been detailed in here, and the post also is the reference for the below example: http://www.sharepointdiary.com/2013/07/how-to-make-sharepoint-list-column-form-field-read-only.html.

SPUtility

Instead you can use the SPD to customize the field to become read only with the help of SPUtility.

Once you have your SPUtility imported and referenced on your SharePoint, a field can be made read only as following:

SPUtility.GetSPField('Fieldname').MakeReadOnly();

jQuery

$(document).ready(function(){
    $("input[title='Fieldname']").attr("readonly","true");
    //Optional disabling of the field:
    $("input[Title='Fieldname']").attr("disabled", "disabled");
});

PowerShell

Another option would be to use PowerShell for this. The PowerShell way of doing this however hides the field from the forms, so that should be noted.

$web = Get-SPWeb "http://sharepoint.domain"
$List = $Web.Lists["List"]
$Field = $List.Fields["Fieldname"]
$Field.ReadOnlyField = $true
$Field.Update()

(The above linked blog post includes steps for a PS script which shouldn't make the field hidden, but this seems like viable for older versions of SP only.)

  • Not a huge code guru, do you have an example of the jquery in action – pinkstonmatt Jun 30 '17 at 9:51
  • I added this to my code – pinkstonmatt Jun 30 '17 at 10:26
  • <script type="text/javascript"> $(document).ready(function() { //Set the Field to Read only and change its background colour $("input[title='status_x0020_history']").attr("readonly","true").css('background-color','#F6F6F6'); //You can disable the field also: $("input[Title='Metrics ID']").attr("disabled", "disabled"); }); </script> Should that work, does not seem too... where should it be positioned – pinkstonmatt Jun 30 '17 at 10:27

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.