I have two people pickers in a list. I use the following snippet, to insert the current user into the people picker:
var peoplePickerDiv = $("[id$='ClientPeoplePicker'][title='" + fieldName + "']"); var peoplePickerEditor = peoplePickerDiv.find("[title='" + fieldName + "']"); var peoplePickerId = peoplePickerDiv.attr('id'); var peoplePickerObject = SPClientPeoplePicker.SPClientPeoplePickerDict[peoplePickerId]; peoplePickerEditor.val(userAccountName); peoplePickerObject.AddUnresolvedUserFromEditor(true);
It works great in IE11. In Firefox however, it only puts the name into the first field but not completely resolves it (it is underlined red as when the Spellcheck is active) and the second people picker doesn't get touched at all.
But then I do this step by step in the debugger (using F11), it works like a charme.