title: Blazor - How to dynamically create inputs and then read their values
body: <p>I have a form on a blazor website that I am trying to define. The user selects how many textboxes to create. Based on that number, they are created. I need to then total the number typed into these textboxes.</p>
  <p>I can create the desired number of text boxes, but where I'm struggling is dynamically binding a value to it so that I can create a function to total the numbers typed in. I've done some research, and see I can bind them to a collection.</p>
  <p>This is what I'm trying... But it is not working, any help would be great.</p>
  <pre><code>  &lt;td&gt;EE Only&lt;/td&gt;
                          @{
                              for (int i = 0; i &lt; AppData.PlanOption; i++)
                              {
                                  &lt;td&gt;
                                      &lt;input @bind=&quot;eevalue.Vals&quot; @bind:event=&quot;oninput&quot; @onchange=&quot;() =&gt; IncrementEETotal()&quot; /&gt;
                                  &lt;/td&gt;
                              }
                          }
  &lt;td style=&quot;background-color: rgb(192, 206, 219);&quot;&gt;&lt;input class=&quot;field&quot; readonly @bind=&quot;eeTotal&quot; /&gt;&lt;/td&gt;
  
  @code {
  
  
      private void IncrementEETotal()
      {
          eeTotal = eevalue.Vals.Sum();
      }
  
      public class EEVals
      {
          public List&lt;int&gt; Vals { get; set; } = new List&lt;int&gt;();
      }
  
  
      public class EEItem
      {
          public int val { get; set; }
          public string name { get; set; }
      }
      public EEVals eevalue { get; set; } = new EEVals();
  
  
  }
  
  
  </code></pre>