Javascript validation for a dynamic gridview have checkbox
<p>I have created a GridView Dynamically. This dynamic gridview has two Template Field column. Both the column has checkboxes in every row. How do I write the client side validation so that only one checkbox is checked at a given time in a particular row.</p>

<p>I tried using this code but it didn't work</p>

<pre><code>  function MutExcCheckBox()
  { 
    var wipChk = document.getElementById("ckhBoxSelect");
    var aukChk = document.getElementById("chkBoxABC");
    for(i = 0; i&lt;wipChk.length ; i++)
    {
        if(wipChk[0].checked==true)
        {
          aukChk[0].checked=false;

        }else if (aukChk[0].checked==true)
        {
            wipChk[0].checked=false;
        }
    }
</code></pre>

<p>I have added the <code>Onclick</code> attribute from code behind.</p>

<pre><code>ckh.Attributes.Add("Onclick", "MutExcCheckBox()");
</code></pre>

<p>Thanks</p>
