Hi,
To clear a people picker field, do this the old way:
// There's no easy way to find one of these columns; we'll look for the comment with the columnName
var searchText = RegExp("FieldName=\"" + columnName + "\"", "gi");
// Loop through all of the ms-formbody table cells
$("td.ms-formbody").each(function() {
// Check for the right comment
if (searchText.test($(this).html())) {
$(this).find("div[Title='People Picker']").html("");
$(this).find("textarea[title='People Picker']").val("");
$(this).find("img[Title='Check Names']").trigger("click");
return false;
}
});
↧