if (list.options[i].selected) {
listval=list.options[i].value +"," + listval
}
if muliple items are slected then there is no issue but if only one item is selected i get i double times
<asp:UpdatePanel ID="UpdatePanel2" runat="server" > <ContentTemplate> <div runat="server" style="position: absolute; z-index: 122; " id="divcity"> <asp:ListBox ID="drpcity" runat="server" Height="252px" SelectionMode="Multiple" Width="141px"></asp:ListBox></div> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnpb" /> </Triggers> </asp:UpdatePanel> var list = document.getElementById('drpcity'); debugger; for (var i = 0; i <=list.options.length-1; ++i) { if (list.options[i].selected) { var lstval ; lstval = list.options[i].value +","+ lstval ; } }
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.