lundi 2 janvier 2017

use jquery find repeater checkbox checked value

I have a checkbox template field within a repeater in c#

bind the repeater using asp.net c#

<asp:Repeater ID="rpt_detail" runat="server">
         <ItemTemplate>
                    <table>
                        <tr>
                              <td style="width: 10%; padding-top: 10px;">
                                     <input type="checkbox" id="selectit" name="selectit" value='<%# Eval("mdID") %>' />
                             </td> 
                              <td >
                              <asp:Label ID="mdID" runat="server" Visible="false" Text='<%# Eval("mdID") %>'></asp:Label>
                               </td>
                                <td>
                                                    <asp:Label ID="lbl_xprice" runat="server" Text='<%# Eval("mdPrice") %>'></asp:Label>
                                 </td>
                          </tr>
                                    </table>
          </ItemTemplate>
</asp:Repeater>
<input id="ttt" name="" type="button" class="btn btn-warning btn-small btn-md" value="add"  onclick="aaaaa()" />

and javascipt

<script>


                function aaaaa() {

                    var selectit = $('input[name="selectit"]').val();

                        $.ajax({
                            url: "ajaxservice/getinchar.aspx",
                            type: 'POST',
                            data: { selectw:selectit},
                            success: function (result) {
                                $("#testview").html(result);
                            }
                        });
                    }
 </script>

How can I get checkbox checked value ?




Aucun commentaire:

Enregistrer un commentaire