This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - Add GroupIdentity members to dropdownlist

sherenegladysj - Tuesday, March 2, 2010 7:12 AM:

Hello all,

I want to add members of Group Identity to a dropdown list; I'm getting error while running this code.

  var selectObj = document.getFieldByName("doccontrol");  'doccontrol is the dropdownlist field name
   var opt = document.createElement("OPTION");
   selectObj.add(opt);
   opt.innerText = identityName;   'identityname is the member of GroupIdentity
   opt.value = identityName;

I'm executing the above code based on member count in that Identity. What I've done wrong???

Thanks & Regards,

Sherene



jenC - Tuesday, March 2, 2010 4:56 PM:

We do this and it works for us:

 

//arr is an array in this case but you would change it to be your list of identity names
for (var i =0; i < arr.length - 1; i++)
{
   var opt = document.createElement("OPTION");
   opt.text = arr[i]; //whatever value you want
   opt.value = arr[i];
   document.getElementById("doccontrol").options[i+1] = opt;

}