SharePoint designer – disable controls (read-only) in Edit Form – SharePoint 2013, Office 365

There may be a case where you will need to disable a control to read only. The best way I’ve found to do this without a form editing tool, is in SharePoint Designer.

Open SharePoint Designer > Lists and Libraries > double click the list that you need to adjust.

Create a new “Edit” Form (do not delete the original).

EditButton

Name your form > Select “Edit item form (used to edit existing list items) > select “Set as default form for the selected type > If you have more than one content type, select the one you would like to use > Click OK.

EditNDisplay

Double click the new form to open

OpenEditndisplay

The code window will open > Select the “Advanced Mode” icon in the ribbon.

AdvancedMode

Look for the line “xsl:template name=”dvt_1.rowedit”.

The controls will be located between the

tags. The first set of

tags contain the label, the second set contains the control that will need to be revised to display in read only mode.

  1. Label/Header
  2. Control to be changed to read only.

xsltemplate

Find the two “ControlMode” tags

ControlModeEdit

Change the “ControlMode” tags from “=Edit” to “=Display” in both tags. In this example I’ve changed two sets of tags.

ChangeControls2

Save your work > you may receive a “Site Definition Page Warning”, select yes.

siteDefWarning

Preview your form, in this case the title was empty, and Territory contains the word Northern that is now read only.

EditForm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s