Created
April 22, 2016 13:07
-
-
Save hemache/ca1cb13a180cb852a86567b2656dc998 to your computer and use it in GitHub Desktop.
SharePoint people picker prevent select everyone group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function PreSaveAction() { | |
try { | |
var selectedValues = JSON.parse($('[id*="$ClientPeoplePicker_HiddenInput"]').val()), | |
returnValue = true; | |
for(i=0; i < selectedValues.length; i++){ | |
var selectedValue = selectedValues[i]; | |
if(selectedValue.IsResolved && (selectedValue.ProviderName == "AllUsers" || selectedValue.Key == "c:0(.s|true")){ | |
returnValue = false; | |
} | |
if(!selectedValue.IsResolved && (selectedValue.Key.toLowerCase() == "tout le monde" || selectedValue.Key == "الجميع")){ | |
returnValue = false; | |
} | |
} | |
} catch(e){ | |
} | |
return returnValue; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment