title: Issues with sum and relatives parents
body: <p>I have a problem with my code and I hope you can help me.</p>
  
  <p>I have a form in which you have to select the maximum size of a Disk and the relatives Disk's numbers.
  The sum of each disk's numbers can't be greater than the size of the relative disk. (Please see the image)</p>
  
  <p><img src="https://i.stack.imgur.com/g1BB8.png" alt="image explanation of the problem. 2 DISKs"></p>
  
  <p>I tried lot of things but I problems with the form (classes, query etc).</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function check_number23() {
    let ProjectName = document.getElementById("resultsprojectname").innerHTML;
  
    var sizediskN1 = document.getElementsByClassName("sizediskN1");
  
  
    var value = Object.keys(sizediskN1).length;
  
    var disksizeN = document.getElementsByClassName("disksizeN");
    var disksizeNkey = Object.keys(disksizeN).length;
  
  
  
    for (var h = 0; h &lt; value; h++) {
      var storagevalue = +sizediskN1[h].value;
    }
    alert(storagevalue);
  
  
  
    for (var j = 0; j &lt; disksizeNkey; j++) {
      var storagemax = document.getElementsByClassName("disksizeN")[j].value;
  
      if (storagevalue - storagemax &lt;= 0) {
        result = storagevalue + " GiB of Standard Partitions can be used.";
        document.getElementsByClassName("negativenumberchecker23")[h].innerHTML = result;
      } else {
        result = storagevalue + " GiB of Standard Partitions can't be used. Insert a new value.";
        alert(result);
        sizediskN1[h].value = '0';
      }
    }
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;label&gt;Disk Size (GiB)&lt;/label&gt; &lt;input class="form-control disksizeO" type='number' min="1" onchange="check_numberDSKSizeO(this)" name='disksizeO[]' oninput="validity.valid||(value='0');" value='0' /&gt;
  &lt;label&gt;Size (GiB):&lt;/label&gt;
  &lt;input type='number' min="0" oninput="validity.valid||(value='0' onchange=" check_number23(this) " name='sizediskN1[]'  class='sizediskN1 form-control'&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I hope my problem is clear... Please help.. </p>