We have a customer who would like to disable the ability for end users to type in values directly for a UserField control in a page layout. They would like the users to only use the adress book.

We have the similar functionality on another site but there we use the PeopleEditor control. That control have the attribute AllowTypeIn which gives us the ability to force the users to use the Adress book instead.

How would I achieve the same functionality for a UserField? Should I use a script or can I do some override of the UserField control?


2 Answers 2


You can use following code. you will need jQuery for that:

    $(document).ready(function () {
    $('table.ms-usereditor div.ms-inputuserfield').attr('contenteditable', 'false')

for deployment you can use CustomAction as described here


Declare your field in markup as this:

 <SharePoint:UserField ID="UfEmployee" runat="server" FieldName="Employee"/>

To Disable use this code in OnPrerender:

   var ppe = (PeopleEditor)UfEmployee.TemplateContainer.FindControl("UserField");
   ppe.Enabled = false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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