Click here to Skip to main content
15,884,176 members

i have a javscript to get checked text value from checkboxlist but im gettin "on" as a value instead of it's text

Revision 1
My Code:
script type="text/javascript" language="javascript">
function GetTextValue() {
var checkList = document.getElementById('CheckBoxList1');
var checkBoxList = checkList.getElementsByTagName("input");
var checkBoxSelectedItems = new Array();
var values = "";
var i = 0;
for (i = 0; i < checkBoxList.length; i++) {
if (checkBoxList[i].checked) {
checkBoxSelectedItems.push(checkBoxList[i].value);
values = values + checkBoxList[i].value + ",";
alert('checked - checkBoxList[i]: ' + checkBoxList[i].value)
}
}
var category = values;
}
</script>

For example if i select three check box then it shows like this "on, on, on"
Posted 6-Feb-13 20:55pm by Member 9378829.
  Print Answers RSS
Top Experts
Last 24hrsThis month