title: Submitting multiple input fields with same field name- ReactJs
body: <p>I have a Player form that takes multiple player inputs, and on submit, all the players are added to a mongodb collection.  I'm not sure what the best way is to handle the multiple inputs.  The code below so far only has inputs for one player. If I want to add multiple inputs to add up to 10 players, does each input field need to have a unique name? If so, how would it fit into my addPlayerToTeam function?  Thanks in advance!</p>
  
  <pre><code>export default class AddPlayersForm extends Component {
  constructor(props) {
      super(props);
      this.submitForm = this.submitForm.bind(this);
  }
  
  submitForm(event) {
      event.preventDefault();
  
      this.props.addPlayerToTeam({
          firstName: event.target.firstName.value,
          lastName: event.target.lastName.value,
          email: event.target.email.value,
          height: event.target.height.value,
  
  
      })
  }
  
  render() {
      return (
          &lt;div&gt;
              &lt;h2&gt;Add players&lt;/h2&gt;
              &lt;h4&gt;Must have a minimum of 5 players to complete registration&lt;/h4&gt;
              &lt;Table&gt;
                  &lt;Form onSubmit={(event) =&gt; this.submitForm(event)}&gt;
                      &lt;FormGroup&gt;
                      &lt;thead&gt;
                          &lt;tr&gt;
                              &lt;th&gt;First Name&lt;/th&gt;
                              &lt;th&gt;Last Name&lt;/th&gt;
                              &lt;th&gt;Email&lt;/th&gt;
                              &lt;th&gt;Height&lt;/th&gt;
                          &lt;/tr&gt;
                          &lt;InputGroup&gt;
                          &lt;tr&gt;
                              &lt;td&gt;&lt;Input type="text" name="firstName" id="firstName" /&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;Input type="text" name="lastName" id="lastName" /&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;Input type="text" name="email" id="email" /&gt;&lt;/td&gt;
                              &lt;td&gt;&lt;Input type="text" name="height" id="height" /&gt;&lt;/td&gt;
                          &lt;/tr&gt;
                          &lt;/InputGroup&gt;
  
                      &lt;/thead&gt;
                  &lt;/FormGroup&gt;
                  &lt;/Form&gt;
              &lt;/Table&gt;
  
          &lt;/div&gt;
      )
  }
  </code></pre>
  
  <p>}</p>