Let me tell you about objects in my page. I have a listview. And i have a checkbox in this listview(in itemTemplate tag). And i have a html button outside of listview. Id of listview is:"myListView". Id of checkbox is "checkBoxSec". Id is html button is "btnConfirmSelected". What is my purpose; Let's assume listview shows me 100 records when page loads. And let's assume i select some checkboxes. Let's assume i select these: 3, 5, 7, 33, 56, 78, 99. (let's assume these numbers are ID values of the selected records). When i click html button i need one string like this: 3, 5, 7, 33, 56, 78, 99 I need that javascript code. This javascript codes is going to find selected checkbox. and then get their values. and then put all values together with comma. i need that string. thanks. Let me share my code:
<asp:ListView ID="myListView" runat="server" OnItemCommand="listView_OnItemCommand"
OnItemDataBound="listView_ItemDataBound">
<LayoutTemplate>
<table id="listViewRecordsTable" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered table-condensed">
<thead>
<tr>
<th style="text-align: left;">
<asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="false" onchange="CheckAll(this);" />
</th>
<th style="text-align: left;">
process no
</th>
</tr>
</thead>
<tbody>
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr class="odd gradeX" id="<%# Eval("ID").ToString() == "BOS" ? "" : Eval("ID")%>">
<td>
<asp:CheckBox ID="checkBoxSec" runat="server" CssClass="checkBoxExample" Value='<%#Eval("ID") %>' />
</td>
<td>
<%# Eval("surecID").ToString() == "empty" ? "" : Eval("surecID")%>
</td>
</tr>
</ItemTemplate>
and here is the html button
<input id="btnFindThem" type="button" value="find selected checkbox and get their values" />
thanks