I have a input checkboxes in listitems and i need to fetch the selected checkbox text.Below is my html code and i had differentiated the unchecked checkbox with the checked checkbox
<li tabindex="-1" role="option" unselectable="on" class="k-item">//unchecked check box
<input type="checkbox" name="Type" onclick="Check(event);" class="cbComp" value="40532"> Unselected check box
</li>
<li tabindex="-1" role="option" unselectable="on" class="k-item k-state-selected k-state-focused" id="ddlActTypeCompletedKD_option_selected" aria-selected="true"> //checked chekbox
<input type="checkbox" name="cbCareActType" onclick="onCareActCompletedCheck(event);"
class="cbCareActTypeComp" value="40549">Checked checkbox1
</li>
<li tabindex="-1" role="option" unselectable="on" class="k-item k-state-selected k-state-focused" id="ddlActTypeCompletedKD_option_selected" aria-selected="true"> //checked chekbox
<input type="checkbox" name="cbCareActType" onclick="onCareActCompletedCheck(event);"
class="cbCareActTypeComp" value="50890">Checked checkbox2
</li>
Using below code I am getting all the checked checkboxes values in comma separated, but I need to bring the text.
How can I do this?
Text = $('#Addhdn').val();
//I am getting values as 40549,50890 as those both are checked using these values but when i am assigning to text variable ids are going instead i need to send the text
$("#ddl").find('.k-input').html(Text); //here i need to bind text instead of ids
<input type="text" id="AddActTypeCompletedhdn" style="display: none;" value='' />
Input will be the values in the hidden field Example -40549,50890
Output should be the text of those values to be displayed as comma seperated in dropdown Expected output- Checked checkbox1,Checked checkbox2
checked two checkboxes but always its binding only one instead it should bind all checked items as comma seperated