How to assign array element to hidden field using javascript.
I want to assign array element to hidden field below i have attached a script which is not working for me:
function ClientTransferred(sender, e) {
var arr = new Array(); debugger;
var RadAddHiredest = $find("<%=RadAddHiredest.ClientID%>");
for (i = 0; i < RadAddHiredest.get_items()._array.length ; i++) {
arr[i] = RadAddHiredest.get_items()._array[i].get_text();
}
var collator = new Intl.Collator(undefined, { numeric: true, sensitivity: 'base' });
arr = arr.sort(collator.compare);
$('<%=hdarrlist.ClientID %>d').val(JSON.stringify(arr)); //store array
var value = $('<%=hdarrlist.ClientID %>').val(); //retrieve array
value = JSON.parse(value);
alert(value);
}
Plz help me as soon as possible.