locked
How to disable people picker with browse and checknames for particular control RRS feed

  • Question

  • Hi,

                  I am using
                                  $(this).find("a[Title='Check Names']").click();
                                   $(this).find("a[Title='Browse']").attr("onclick","");

                    to disable checknames and browse but it is disabling for all people picker controls and I need to disable for only particular control and all other people picker controls should display these elements. Kindly suggest any possible ways or references to achieve this.

    Thanks


    Razvi444

    Wednesday, May 7, 2014 2:53 PM

Answers

  • Add thi script on that page

    http://asharepointsolutions.blogspot.in/2012/06/disable-sharepoint-people-picker.html

    /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>

    https://forum.jquery.com/topic/disable-make-readonly-people-picker-column-in-sharepoint-2010

    • Marked as answer by JasonGuo Monday, May 19, 2014 2:02 AM
    Wednesday, May 7, 2014 3:11 PM

All replies

  • When you say you want this to be disabled for "only particular control" and not all, what exactly is the context here? People pickers on one specific form? One specific people picker field within a form that has multiple? Please elaborate...

    Also out of pure curiosity, what is the goal here or why do you need to do this?

    Wednesday, May 7, 2014 3:01 PM
  • Add thi script on that page

    http://asharepointsolutions.blogspot.in/2012/06/disable-sharepoint-people-picker.html

    /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>

    https://forum.jquery.com/topic/disable-make-readonly-people-picker-column-in-sharepoint-2010

    • Marked as answer by JasonGuo Monday, May 19, 2014 2:02 AM
    Wednesday, May 7, 2014 3:11 PM