Hi there,
I have a ListBox with Multiple Selection feature. After I click the Button on the form, I should process the selected items in the ListBox. The code works fine but after I add the ListBox in an UpdatePanel, it does not preserve selected items.
Any suggestions?
Thanks,
Mosh
function addItemstoHiddenField(){
var lbPlantDest = document.getElementById("lbPlantDest");
var lbSalesDest = document.getElementById("lbSalesDest");
var lbPlantDest = document.getElementById("lbPlantSrc");
var lbSalesDest = document.getElementById("lbSalesSrc");
var hdnPlantAccess = document.getElementById('hdnPlantAccess');
var hdnSalesAccess = document.getElementById('hdnSalesAccess');
var hdnPlantAccess = document.getElementById('hdnSrcPlantAccess');
var hdnSalesAccess = document.getElementById('hdnSrcSalesAccess');
for (i = lbPlantDest.options.length - 1; i >= 0; i--) {
hdnPlantAccess.value = hdnPlantAccess.value + lbPlantDest.options[i].value + ',';
}
for (i = lbSalesDest.options.length - 1; i >= 0; i--) {
hdnSalesAccess.value = hdnSalesAccess.value + lbSalesDest.options[i].value + ',';
}
for (i = lbPlantSrc.options.length - 1; i >= 0; i--) {
hdnSrcPlantAccess.value = hdnSrcPlantAccess.value + lbPlantSrc.options[i].value + ',';
}
for (i = lbSalesSrc.options.length - 1; i >= 0; i--) {
hdnSrcSalesAccess.value = hdnSrcSalesAccess.value + lbSalesSrc.options[i].value + ',';
}
}
No comments:
Post a Comment