title: React handle form submit
body: <p>I'm trying to create a form in React/Redux. For now I just want the form to trigger my function handleSubmit when the form is submitted. However at the moment it looks like the function is triggered instantly on page load ...</p>
  
  <pre><code>export default class AssetsAdd extends React.Component {
  
    componentDidMount() {
      console.log(this)
    }
  
    handleSubmit(event) {
      if (this.refs.titleInput !== '') {
        event.preventDefault();
        var asset = {
          date: '',
          title : this.refs.titleInput.value,
          id : '',
          type: this.refs.typeInput.value
        }
  
        return this.props.dispatch(addAsset(asset))
      }
  
  
    }
  
    render() {
      return (
        &lt;div&gt;
          &lt;Row&gt;
            &lt;Portlet title='New Asset' form&gt;
              &lt;Form horizontal onSubmit={this.handleSubmit}&gt;
                &lt;FormGroup&gt;
                  &lt;Label text='Title' size='3' /&gt;
                  &lt;Input ref="titleInput" placeholder='Enter asset title' size='4'/&gt;
                &lt;/FormGroup&gt;
                &lt;FormGroup&gt;
                  &lt;Label text='Type' size='3' /&gt;
                  &lt;Input ref="typeInput" placeholder='Enter asset type' size='4'/&gt;
                &lt;/FormGroup&gt;
                &lt;FormGroup&gt;
                  &lt;Label text='Description' size='3' /&gt;
                  &lt;Input ref="descriptionInput" placeholder='Enter asset description' size='4'/&gt;
                &lt;/FormGroup&gt;
                &lt;FormGroup&gt;
                  &lt;Label text='Documentation' size='3' /&gt;
                  &lt;Input ref="documentationInput" placeholder='Enter documentation URL' size='4'/&gt;
                &lt;/FormGroup&gt;
                &lt;FormActionBar&gt;
                  &lt;SubmitButton value='Submit'/&gt;
                  &lt;CancelButton value='Cancel'/&gt;
                &lt;/FormActionBar&gt;
              &lt;/Form&gt;
            &lt;/Portlet&gt;
          &lt;/Row&gt;
        &lt;/div&gt;
      )
    }
  }
  
  function mapStateToProps(state) {
    return {
      assets: state.assets
    };
  }
  
  export const AssetAddContainer = connect(mapStateToProps)(AssetsAdd);
  </code></pre>
  
  <p>I know the rest of the code isn't all correct yet but my main concern now is just getting the onSubmit action triggered at the right moment.</p>
  
  <p>Thanks in advance!</p>