0

How how can I get the value from a people picker control?

 if (colListItem.get_item(User).length > 1) {
                for (var i = 0; i < colListItem.get_item(User).length; i++)
  {
  //Append all User names with a semi colon separator

               _User = _User + colListItem.get_item(User)[i].get_lookupValue() + ";";
                }
                        _User.trim;
                }
                }
            }

This works if there is more than one value in the people picker control. But if there is only one value, I am unable to retrieve it.

bjb568
  • 11,089
  • 11
  • 50
  • 71
user2598808
  • 633
  • 5
  • 22
  • 40

1 Answers1

0

Change it from:

if (colListItem.get_item(User).length > 1)

To:

if (colListItem.get_item(User).length >= 1)

If there is only one value, only the second one will be true.

bjb568
  • 11,089
  • 11
  • 50
  • 71