0

How to disable specific people picker field in a list in edit form . Not all the people picker field present in that specific list. Below code disable all people picker field

$(".sp-peoplepicker-delImage").css({ 'display' : 'none'}); $(".sp-peoplepicker-editorInput").css({ 'display' : 'none'});

I want to disable specific people picker field.

2
  • 1
    require more information, can you be more specific and provide few screen shots of what you want to achieve? Commented Aug 27, 2018 at 16:17
  • I have a list in which I have 3 people picker column .out of which I want to disable only one people picker column in my edit form based on particular security group
    – Pp25
    Commented Aug 27, 2018 at 18:51

3 Answers 3

0

Using jQuery selectors, you can target a specific column using the internal name. Below is the selector ^ which means "Begins with".

$("input[id^='internalColumnName']").prop("disabled", true);
$(".sp-peoplepicker-delImage[id^='internalColumnName']").prop("disabled", true);
$(".sp-peoplepicker-delImage[id^='internalColumnName']").css({"display": "none"});
1
  • Glad to hear! :) Commented Aug 28, 2018 at 8:07
0

If you have a text area that is currently set as a people picker, and you no longer want it to be set as such, you can change the type to a single line of text, etc. In the List Settings, click the field in question, and change the type from there.

1
  • No I want to disable specific people picker field in edit form
    – Pp25
    Commented Aug 27, 2018 at 17:54
0

Set the 'contentEditable' property of the people picker field to false.

  • To disable all the people picker fields - $('[title="People Picker"]').attr("contentEditable","false");
  • To disable a specific people picker - $('#divID').attr("contentEditable","false");, where divID is the ID of the people picker div

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.