title: How to make required atleast one checkbox when one of the main check box is checked
body: <p>I want to require at least one checkbox from all when one of the upper checkboxes is <a href="https://i.stack.imgur.com/6M3GW.png" rel="nofollow noreferrer">enter image description here</a>clicked. the snap is attached herewith.</p>
  <p>here is the javascript code</p>
  <pre><code>function toggleOtherTextboxVisiblewh()
  {
      var check = document.getElementById('wh');
      var chk2=document.getElementsByName('s1[]');
     var chk3=document.getElementsByName('q1[]');
      if (check.checked) {
          document.getElementById('sizewh').style.display = 'block';
          
      }
      else {
             document.getElementById('sizewh').style.display = 'none';
        
             for (i=0;i&lt;chk2.length;i++)
                  chk2[i].checked=false;
                  
             for (b=0;b&lt;chk3.length;b++)
                  chk3[b].value = &quot;&quot;;
      }            
              
  
  
  }
  </code></pre>