title: C# MVC Textbox on the specific table row (disable) when the button is clicked
body: <p>I have a table whose values are looped with my product list and I have a textbox for 'Quantity' and a button for 'Add to Cart'. I am trying to do when I click on 'Add to Cart' button, it will check the Quantity value if it has value or not then the 'Quantity' textbox will get disabled for that specific row only.</p>
  
  <p>Product.cshtml</p>
  
  <pre><code>&lt;table id ="productList" class="table table-dark"&gt;
      &lt;tr&gt;
          &lt;th&gt;Product ID&lt;/th&gt;
          &lt;th&gt;Title&lt;/th&gt;
          &lt;th&gt;Description&lt;/th&gt;
          &lt;th&gt;Quantity&lt;/th&gt;
          &lt;th&gt;Add to cart&lt;/th&gt;
      &lt;/tr&gt;
      @foreach (var item in Model)
          {
              &lt;tr class="active"&gt;
                  &lt;td&gt;@item.Id&lt;/td&gt;
                  &lt;td&gt;@item.Title&lt;/td&gt;
                  &lt;td&gt;@item.Description&lt;/td&gt;
                  &lt;td&gt;@Html.TextBox("Quantity", "0", new { @class = "form-control" })&lt;/td&gt;
                  &lt;td&gt;&lt;button class="btn btn-default pull-left" onclick="disableText(Quantity);" id="btn-addToCart"&gt;Add To Cart&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
          }
  &lt;/table&gt;
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>function disableText(QtyVal) {
      if(QtyVal.value == '')
      {
          document.getElementById("Quantity").value = 1;
      }
  }
  </code></pre>
  
  <p>Currently the output of my project is everytime I click any submit button, it will always update the first row (which is incorrect). </p>
  
  <p>The goal is it will update the Quantity and disable it for that specific row</p>