I have a form that contains an element of type SPUser like this picture :
It's a combox witch contains the name of SPUser.Does any one have an idea.
I am using SharePoint foundation 2013.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI have a form that contains an element of type SPUser like this picture :
It's a combox witch contains the name of SPUser.Does any one have an idea.
I am using SharePoint foundation 2013.
You can use CSOM for getting all site users, use following example
var collListItem;
function GetAllUsers()
{
var clientContext = new SP.ClientContext.get_current();
var web = clientContext.get_web();
var userInfoList = web.get_siteUserInfoList();
collListItem = userInfoList.getItems();
clientContext.load(collListItem);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded),Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded(sender, args)
{
//Iterate through CollListItem and fill the combobox
}
function onQueryFailed(sender, args)
{
alert('Failed');
}