In user control page
<SharePoint:ClientPeoplePicker
id="ppApprover"
runat="server" Rows="1"
AllowMultipleEntities="false"
CssClass="ms-long"/>
<asp:CustomValidator
ID="cstmVald2" runat="server" ControlToValidate="ppApprover" Display="Dynamic"
ValidationGroup="vgCreateSE"
ValidateEmptyText="true"
SetFocusOnError="true" ErrorMessage="Please enter SDU Head(GM & above)"
CssClass="ms-error"
ClientValidationFunction="peoplvalidator"></asp:CustomValidator>
function
peoplvalidator(sender, args) {
args.IsValid =
false;
var user =
$("span.ms-entity-resolved").attr("title");//Returns the Login Name
if (user != undefined)
{
args.IsValid = true;
}
}
No comments:
Post a Comment