0
<asp:CheckBoxList ID="ckbLstPartner" runat="server" RepeatDirection="Horizontal" CssClass="cssRdlstMoheSacm">
<asp:ListItem Text="Yes" Value="1"></asp:ListItem>
<asp:ListItem Text="No" Value="0"></asp:ListItem>
</asp:CheckBoxList>

In the above CheckBoxList, I'm trying to get the (selected value) by JQuery to hold it and store it in
in the DB. Please check the below JQuery:

$('#<%=ckbLstPartner.ClientID %>').foreach(function () {
        if ($(this).is(':checked')) {
          ***// ??***
        }
        else {
        }
    });

2 Answers 2

1

just this

$('#<%=ckbLstPartner.ClientID %>').find('option:checked').val();

or

$('[id$=ckbLstPartner]').find('option:checked').val();
Sign up to request clarification or add additional context in comments.

1 Comment

If I want to Unckeck the other option ? What I'v to do ?
0

Get checked value

$('#<%=ckbLstPartner.ClientID %>').find('option:checked').val();

.val()

.find()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.