Sharepoint People picker validation in javascript
var validatorId = 'validator ID';
var textboxId = validatorId.replace('val_pck', 'txt_pck');
var pickerId = validatorId.replace('val_pck', 'pck');
var pickerValue = $("#" + pickerId).html();
if (pickerValue == "" || pickerValue.indexOf('title') == -1 || $("
" + pickerValue + "
").find("#divEntityData").length == 0){
alert('invalid');
}
set the value of people picker
var pickerKey = $("
"
+ pickerValue + "if (args.IsValid && $('#' + textboxId)) $('#' + textboxId).val(pickerKey);
1 comment:
What do you do if there are multiple people pickers on the page?
Post a Comment