Jquery Validation in Sharepoint People Picker

If you have a custom form and you had placed people picker control in it and you need to validate it using jquery. please use the following jquery. You should have placed your spservices and jquery library in site library well in hand before that.

<script type="text/javascript" src="http://mysites/SiteAssets/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="http://mysites/SiteAssets/jquery.SPServices-0.6.2.min.js"></script>
<script type="text/javascript">

$(document).ready(function() {

var username =$().SPServices.SPGetCurrentUser({
fieldName: "Title"
});

var user= $("#customPeoplePicker").text();
if (username==user)

{

$("input[value='Submit']").attr('disabled',true);

}

});
Happy Share Pointing :-)
Ebook Download
View all
Learn
View all