title: Bind and validate inputs for model which has IList
body: <p>I need form on which I have inputs that should be bind for list in model... Example</p>
  <pre><code>public class InviteMembersViewModel
      {
          public InviteMembersViewModel()
          {
              Members = new List&lt;InviteMemberViewModel&gt;();
          }
          public IList&lt;InviteMemberViewModel&gt; Members { get; set; }
          public string CompanyName { get; set; }
      }
  </code></pre>
  <p>I try like this</p>
  <pre><code>$addNewItem.on('click', function () {
              var templateString = '&lt;div id=&quot;item-template'+index+'&quot;&gt;'
                  + '&lt;div class=&quot;card h-100 d-flex flex-column mx-2 px-2 py-3 mt-3 js-item-container&quot;&gt;'
                  + '&lt;div class=&quot;d-flex&quot;&gt;'
                  + '&lt;div class=&quot;flex-grow-1 mb-3 row&quot;&gt;'
                  + '&lt;div class=&quot;text-nowrap text-100 text-dark-l2 col-md-6&quot;&gt;'
                  + '&lt;label class=&quot;label&quot;&gt;@Resources.EmailAddress&lt;/label&gt;'
                  + '&lt;input class=&quot;form-control&quot; data-val=&quot;true&quot; data-val-email=&quot;Please enter email in name@domain form.&quot; data-val-length=&quot;Maximum number of characters is 256.&quot; data-val-length-max=&quot;256&quot; data-val-length-min=&quot;0&quot; data-val-regex=&quot;Please enter email in name@domain form.&quot; data-val-regex-pattern=&quot;^[a-zA-Z0-9_.+-]+' + '@Resources.AtSign' + '[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$&quot; data-val-required=&quot;Email should not be empty.&quot; id=&quot;Members_' + index + '_Email&quot; name=&quot;Members_' + index +'_Email&quot; type=&quot;text&quot; value=&quot;&quot;&gt;'
                  + '&lt;span class=&quot;field-validation-valid text-danger&quot; data-valmsg-for=&quot;Members_' + index + '_Email&quot; data-valmsg-replace=&quot;true&quot;&gt;&lt;/span&gt;'
                  + '&lt;/div&gt;'
                  + '&lt;div class=&quot;text-nowrap text-100 text-dark-l2 col-md-6&quot;&gt;'
                  + '&lt;label class=&quot;label&quot;&gt;@Resources.NameOptional&lt;/label&gt;'
                  + '&lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;Members_' + index + '_Name&quot; name=&quot;Members_' + index + '_Name&quot; value /&gt;'
                  + '&lt;/div&gt;'
                  + '&lt;/div&gt;'
                  + '&lt;/div&gt;'
                  + '&lt;div class=&quot;position-tr m-1 dropdown dd-backdrop dd-backdrop-none-md&quot;&gt;'
                  + '&lt;button type=&quot;button&quot; class=&quot;btn btn-sm btn-brc-tp btn-bgc-tp btn-text-pale btn-light-red js-remove-item&quot;&gt;'
                  + '&lt;i class=&quot;fa fa-trash-alt&quot;&gt;&lt;/i&gt;'
                  + '&lt;/button&gt;'
                  + '&lt;/div&gt;'
                  + '&lt;/div&gt;'
                  + '&lt;/div&gt;';
              $container.append($(templateString));
              index++;
          });
  </code></pre>
  <p>Binding is working but JQuery validation of form is always true even if on server ModelState is false.</p>
  <p>To make matters worse, If I use @Html.TextBoxFor and bind just one element from List, validation work correctly but if I manually add input and bind name for model property, that doesn't work.</p>
  <p>Please, help me. What I have to do?</p>