Tuesday, July 10, 2012

Clear People picker on dropdown change index in sp 2010


clearPicker()
{
var control;
var arr = document.getElementsByTagName("div");
for (var i = 0; i < arr.length; i++)
{
if (arr[i].id.indexOf("upLevelDiv") > 0)
{
control = arr[i];
}

}
control.innerHTML = '';
arr = document.getElementsByTagName("input");
for (var i = 0; i < arr.length; i++)
{
if (arr[i].name.indexOf("hiddenSpanData") > 0)
{
control = arr[i];
 }
}
control.value = '';
}

No comments: