Remove All users from PeoplePicker not working

Occasional Contributor

I have been trying to get this to work for 3 days now with no luck. P)lease help. I have 2 people pickers and I can get neither to remove the contents and a dropdown change!

 

/////JQuery 3.4.1 is in the MasterPage//////

<script language="javascript" type="text/javascript" src="/_layouts/15/clientpeoplepicker.js"></script>

<script language="javascript" type="text/javascript">

 

$(document).ready(function(){

       $("select[[Title='Fiscal Year'].change(function()

        {

              PeoplePickerFieldValue("Division Manager")

        }

}

 

function PeoplePickerFieldValue(position)

var DivisionMgr = position;

 

setTimeout(function()

  {

    var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + DivisionMgr + "']");

    alert(peoplePickerDiv); // I get [object Object] only

    var spPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerDiv.[0].id];

 

    if(spPeoplePicker)

      {

        var ResolvedUsersList).each(function(index)

         {

             spPeoplePicker.deleteProcessedUser(this);

         });

    }

  }, 1000);

}

 

0 Replies