title: Passing multiple parameters to function in reactjs
body: <p>I have a json file in node server.js artist object as state</p>
  
  <pre class="lang-json prettyprint-override"><code>{
    id: 1,
    name: "name_test1",
    email: "test1@test1.pl",
    pass: "pass_test1",
  },
  </code></pre>
  
  <p>I created form to add new artist to object :</p>
  
  <pre><code>&lt;div className="form-group"&gt;
      &lt;label for="exampleInputName2"&gt;Name&lt;/label&gt;
      &lt;input
          name="name" className="form-control" placeholder="name" value={this.state.name}
          onChange={this.onInputChange.bind(this, 'name')} /&gt;
    &lt;/div&gt;
    &lt;div className="form-group"&gt;
      &lt;label for="exampleInputEmail2"&gt;Email&lt;/label&gt;
      &lt;input
          type="email" className="form-control" placeholder="email" value2={this.state.email}
          onChange={this.onInputChange.bind(this, 'email')}  /&gt;
  
  &lt;/div&gt;
  &lt;div className="form-group"&gt;
    &lt;label for="exampleInputEmail2"&gt;Password&lt;/label&gt;
    &lt;input
        type="password" className="form-control"  placeholder="password" value3={this.state.password}
        onChange={this.onInputChange.bind(this, 'password')}  /&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;button type="submit" className="btn btn-default" onClick={this.onClick}&gt;Add Artist&lt;/button&gt;&lt;br/&gt;&lt;br/&gt;
  </code></pre>
  
  <p></p>
  
  <p>I want to send the data from the inputs (name, email, password) to my onClick function which looks like :</p>
  
  <pre><code>   onInputChange: function(name, e) {
      var change = {};
      change[name] = e.target.value;
      this.setState(change)
    },
  
  
  
  onClick: function() {
      if (this.state.name !== "" || this.state.email !== "" || this.state.password !=="") {
        Actions.postArtist(this.state.name);
      }
      this.setState({name: ""})
    },
  </code></pre>
  
  <p>But i have no idea how I can pass to onClick function more than one parameter (now i have name, but want also take from my inputs email and password.</p>
  
  <p>When i submit the onClick button on my formulage my object looks like :</p>
  
  <pre><code>{id: 1486368952, name: "BLEH"}
  </code></pre>
  
  <p>and i want looks like this :</p>
  
  <pre><code>{id: 1486368952, name: "BLEH", email: "xxx", password: "xxx"}
  </code></pre>
  
  <p>My postArtist function look like this :</p>
  
  <pre><code>postArtist: function(name, email, password) {
  
  if(!this.artists) {
    this.artists = [];
  }
    var artist = {
      "id": Math.floor(Date.now() / 1000),
      "name": name,
      "email": email,
      "password": password,
      // "password_conf": password_conf
    };
    this.artists.push(artist);
  </code></pre>