title: Wix Code / Why doesn't the select all button select all?
body: <p>I have select all and remove all buttons for check boxes. You can see the code below. But the error is that he should select all of them (not all the options in the check boxes.) Why doesn't the check box select all the options? what is the lack</p>
  <p>Detail
  <a href="https://www.wix.com/velo/forum/community-discussion/why-doesn-t-the-select-all-button-select-all" rel="nofollow noreferrer">https://www.wix.com/velo/forum/community-discussion/why-doesn-t-the-select-all-button-select-all</a>
  [![enter image description here][1]][1]</p>
  <p>My Code</p>
  <pre><code>export function CountrySelectAllt_click(event) {
  
   // number of items in checkbox group
   let totalItems = $w('#checkboxt1'+ &quot;, &quot; +'#checkboxt2'+ &quot;, &quot; +'#checkboxt3'+ &quot;, &quot; 
  +'#checkboxt4').options.length;  
   // initiate a newIndices array to hold all indices
   let newIndices = [];
   for (var i = 0; i &lt; totalItems; i++) {
       newIndices.push(i); 
    }
    console.log(newIndices);
    $w('#checkboxt1').selectedIndices = newIndices;
    $w('#checkboxt2').selectedIndices = newIndices;
    $w('#checkboxt3').selectedIndices = newIndices;
    $w('#checkboxt4').selectedIndices = newIndices;
  
  }
  
   export function CountrySelectAlltreset_click(event) {
  
   // number of items in checkbox group
   let totalItems = $w('#checkboxt1'+ &quot;, &quot; +'#checkboxt2'+ &quot;, &quot; +'#checkboxt3'+ &quot;, &quot; 
  +'#checkboxt4').options.length;  
  // initiate a newIndices array to hold all indices
   let newIndices = [];
   for (var i = 0; i &lt; totalItems; i++) {
       newIndices.push(i); 
    }
    console.log(newIndices);
    $w('#checkboxt1').selectedIndices = [];
    $w('#checkboxt2').selectedIndices = [];
    $w('#checkboxt3').selectedIndices = [];
    $w('#checkboxt4').selectedIndices = [];
  
  }
  
    [1]: https://i.stack.imgur.com/mQBT8.jpg
  </code></pre>