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.
<script>
$(function () {
$("span#DropDownCheckBoxes1 :checkbox").change(function () {
var val = "";
$("span#DropDownCheckBoxes1 :checkbox:checked").each(function () {
val += $(this).next("label").text();
})
$("#Label1").text(val);
})
})
</script>
The output screenshot as below:
Best regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
1 Points
109 Posts
DropDownCheckBoxes checked items in a label
Oct 24, 2016 07:54 AM|ykkumar13|LINK
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.
Thanks
Star
8670 Points
2882 Posts
Re: DropDownCheckBoxes checked items in a label
Oct 25, 2016 12:32 PM|Cathy Zou|LINK
Hi ykkumar13,
Based on your needs, I suggest you could use Jquery. I make an example, I suggest you could refer to it:
JS:
The output screenshot as below:

Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.