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
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
not working in sharepoint online
ReplyDeleteThis not working when page first loaded. Because people picker is late loading
ReplyDeletePlease use window.load instead of document.ready
DeletePlease enable custom scripts from SharePoint Admin
ReplyDelete