Javascript attributes slowing down dynamic table
<p>I have a table that is dynamically created in some c# code-behind when a dropdown is changed.  There 9 columns in this table.  The first 8 should be in one group.  The last attribute in another.  When the last attribute is selected I want the first 8 to go unchecked. When any of the first 8 are checked I wanted the last attribute to go unchecked.  I added some javascript and it works but it causes the tables to load extremely slow. If there is a simpler way please let me know.  Thanks!</p>

<p>adding javascript function calls through c#</p>

<pre><code>attr1.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr2.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr3.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr4.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr5.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr6.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr7.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr8.Attributes.Add("onClick", "uncheckOK(" + rowCount + ");");

attr9.Attributes.Add("onClick", "uncheckAttr(" + rowCount + ");");
</code></pre>

<p>functions to uncheck</p>

<pre><code>function uncheckAttr(row) {
    var chk1 = document.getElementById("MainContent_attr1-" + row);
    chk1.checked = false;
    var chk2 = document.getElementById("MainContent_attr2-" + row);
    chk2.checked = false;
    var chk3 = document.getElementById("MainContent_attr3-" + row);
    chk3.checked = false;
    var chk4 = document.getElementById("MainContent_attr4-" + row);
    chk4.checked = false;
    var chk5 = document.getElementById("MainContent_attr5-" + row);
    chk5.checked = false;
    var chk6 = document.getElementById("MainContent_attr6-" + row);
    chk6.checked = false;
    var chk7 = document.getElementById("MainContent_attr7-" + row);
    chk7.checked = false;
    var chk8 = document.getElementById("MainContent_attr8-" + row);
    chk8.checked = false;
}
function uncheckOK(row) {
    var chk9 = document.getElementById("MainContent_attr9-" + row);
    chk9.checked = false;
}
</code></pre>
