DropDownCheckBoxes checked items in a label RRS feed

  • Question

  • User2001432087 posted

    Hi ,

      I am having a DropDownCheckBoxes  in my application. When I checked items in DropDownCheckBoxes the values will automatically bind to a label and removed when I unchecked the items from the DropDownCheckBoxes . Need to display dynamically using javascript.


    Monday, October 24, 2016 7:54 AM

All replies

  • User-707554951 posted

    Hi ykkumar13,

    Based on your needs, I suggest you could use Jquery. I make an example, I suggest you could refer to it:

    <%@ Register TagPrefix="asp" Namespace="Saplin.Controls" Assembly="DropDownCheckBoxes" %>

           <asp:DropDownCheckBoxes runat="server" ID="DropDownCheckBoxes1" Width="180px" UseSelectAllNode = "false">
                <Style SelectBoxWidth="195" DropDownBoxBoxWidth="160" DropDownBoxBoxHeight="90" />
            <asp:ListItem Text="Mango" Value="1"></asp:ListItem>
            <asp:ListItem Text="Apple" Value="2"></asp:ListItem>
            <asp:ListItem Text="Banana" Value="3"></asp:ListItem>
                <asp:ExtendedRequiredFieldValidator ID = "ExtendedRequiredFieldValidator1" runat = "server" ControlToValidate = "DropDownCheckBoxes1" ErrorMessage = "Required" ForeColor = "Red"></asp:ExtendedRequiredFieldValidator>
                <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>


            $(function () {
                $("span#DropDownCheckBoxes1 :checkbox").change(function () {
                    var val = "";
                    $("span#DropDownCheckBoxes1 :checkbox:checked").each(function () {
                        val += $(this).next("label").text();

    The output screenshot as below:

    Best regards


    Tuesday, October 25, 2016 12:32 PM