I got a task to disable/make people picker control column read-only in a SharePoint list editform.aspx page using jQuery. In my scenario, There are two People Picker Control and I need to disable only one.
After spending good amount of time, I got the solution as shown below:
//Load JQuery file
After spending good amount of time, I got the solution as shown below:
//Load JQuery file
<script type="text/javascript" src="../../jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var columnName = 'Name';
var searchText = RegExp("FieldName=\"" + columnName + "\"", "gi");
$("td.ms-formbody").each(function() {
if(searchText.test($(this).html())) {
$(this).find("div[Title='People Picker']").attr("contentEditable",false);
$(this).find("a[Title='Check Names']").hide();
$(this).find("a[Title='Browse']").hide();
}
});
});
</script>
It works for me thanks.
ReplyDeleteThanks for your suggestion. I will definitely look fer this for future
ReplyDeleteGreatwebpage thiѕ is. I want to of a website that cɑn assist your site ѡith аll of its Internet Marketing requirements.
ReplyDeleteGo to my name link. Thiѕ guy has helped my firm so
much
my site - social media marketing services
it is not working for me. I am using jquery 3.2
ReplyDelete