I am trying to remove a checkbox client-side. Works fine in Chrome. Can’t get it to go in IE8.
document.getElementById('CheckBox3').style.display = 'none';
I’ve also tried style.visibility = 'hidden', style.visibility = 'collapse', as well as disabling the CheckBox. I am able to remove a label to the left of it no problem — all these means work, but none work for removing the CheckBox.
Any ideas?
<td class="DatapointsCheckbox">
<asp:CheckBox ID="CheckBox3" runat="server" AutoPostBack="True" />
</td>
There’s the mark-up.
.DatapointsCheckbox
{
width: 40px;
}
That’s the CSS…
Image: https://i.stack.imgur.com/xYQJN.png
HTML Mark-Up: https://i.stack.imgur.com/3cinf.png (SS of relevant markup, at least)
First, it should be:
In ASP.Net the client ID of the control is compiled at run time and will look like
parent1_parent2_parent3_theControl. Using “ClientID” will give you the full ID of the control. If you don’t use that I wouldn’t expect it to work in any browser, ever.