Enable and Disable Client side People Picker using jQuery

How to enable and disable Client side People Picker using jQuery



By using below methods you can easily enable or disable Client side People Picker:-

function disablePP()
{

$(".sp-peoplepicker-delImage").find("span").css("display","none");

$("input.sp-peoplepicker-editorInput[title='Enter names or email addresses...']").prop('disabled', true);

$("div.sp-peoplepicker-topLevel[title='Enter names or email addresses...']").addClass("sp-peoplepicker-topLevelDisabled");

}

function enablePP()
{


$("div.sp-peoplepicker-topLevel[title='Enter names or email addresses...']").removeClass("sp-peoplepicker-topLevelDisabled");

$("input.sp-peoplepicker-editorInput[title='Enter names or email addresses...']").prop('disabled', false);

$(".sp-peoplepicker-delImage").find("span").removeAttr('style');

}

for more info. please refer People Picker

Comments

  1. not working in sharepoint online

    ReplyDelete
  2. This not working when page first loaded. Because people picker is late loading

    ReplyDelete
    Replies
    1. Please use window.load instead of document.ready

      Delete
  3. Please enable custom scripts from SharePoint Admin

    ReplyDelete

Post a Comment

Popular posts from this blog

How to Customize exported excel's cell background color in Datatables

Populate dropdown using jquery ajax in SharePoint

Customizing SharePoint list and implementing Quick search using jQuery