title: Javascript check all checkboxes in classic asp
body: <p>This is my first time asking question in Stackoverflow</p>
  
  <p>i have a same problem to select specific boxes in asp</p>
  
  <p>i refer to the older post as </p>
  
  <p><a href="https://stackoverflow.com/questions/1543017/javascript-check-all-checkboxes-in-a-table-asp-net">Javascript check all checkboxes in a table / asp.net</a></p>
  
  <pre><code>function toggleCheckBoxes(elem) {
    var div = document.getElementById('&lt;% = divid.ClientID %&gt;');
    var chk = div.getElementsByTagName('input');
    var len = chk.length;
  
    for (var i = 0; i &lt; len; i++) {
      if (chk[i].type === 'checkbox') {
          chk[i].checked = elem.checked;
      }
    }
  }
  </code></pre>
  
  <p>and then </p>
  
  <pre><code>'CheckAll
  &lt;input type="checkbox" id="chkAll" runat="server" onclick="toggleCheckBoxes(this)" /&gt;
  </code></pre>
  
  <p>but my boxes which were : </p>
  
  <pre><code>response.Write "&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_1 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(9))="1" then 
    response.Write " checked"
  response.Write "/&gt;1&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_2 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(10))="1" then 
    response.Write " checked"
  response.Write "/&gt;2&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_3 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(11))="1" then 
    response.Write " checked"
  response.Write "/&gt;3&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_4 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(12))="1" then 
    response.Write " checked"
  response.Write "/&gt;4&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_5 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(13))="1" then 
    response.Write " checked"
  response.Write "/&gt;5&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox  name=process_6 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(14))="1" then 
    response.Write " checked"
  response.Write "/&gt;6&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox  name=process_7 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(15))="1" then 
    response.Write " checked"
  response.Write "/&gt;7&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_8 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(16))="1" then 
    response.Write " checked"
  response.Write "/&gt;8&lt;/td&gt;"
  response.Write "&lt;td nowrap&gt;&lt;input type=checkbox name=process_9 "
  if mEditRecMode and ConvertNullToString(mConsigneeArray(17))="1" then 
    response.Write " checked"
  response.Write "/&gt;9&lt;/td&gt;"
  response.Write "&lt;/tr&gt;"
  response.Write "&lt;/table&gt;"
  </code></pre>
  
  <p>how do i select them all / unselect them  </p>
  
  <p>Please help.</p>