hi i am using a code thru which on a button click event a user is able to add values in a checkboxlist using javascript.
<asp:CheckBoxList id="CheckBoxList1" runat="server">
<asp:listitem Value="1">Item 1</asp:listitem>
</asp:CheckBoxList>
<input type="button" onclick="addToCheckBoxListControl('Item 2', '2');" value="Add To CheckBoxList" />
<script type="text/javascript">
<!--
function addToCheckBoxListControl(textValue, valueValue) {
var tableRef = document.getElementById('<%= CheckBoxList1.ClientID %>');
var tableRow = tableRef.insertRow();
var tableCell = tableRow.insertCell();
var checkBoxRef = document.createElement('input');
var labelRef = document.createElement('label');
checkBoxRef.type = 'checkbox';
labelRef.innerHTML = textValue;
checkBoxRef.value = valueValue;
tableCell.appendChild(checkBoxRef);
tableCell.appendChild(labelRef);
}
// -->
</script>
this is working fine in IE but is not working in firefox. Any idea why this is not working.
thanks