title: How to submit a form through a button outside the form?
body: <p>I want to submit a form through a button which is outside the form and do the validation to that form. I'm using the Form tag from react-bootstrap.</p>
  
  <p>My code doesn't validate the form </p>
  
  <pre><code>&lt;Form
      noValidate
      validated={validated}
      onSubmit={e=&gt; this.handleSubmit(e)}&gt;
  
      &lt;Form.Control
          required
          placeholder="Product Name"
          onChange={e =&gt; this.setState({name: e.target.value })}
          pattern={"[A-Z a-z]{3,30}"}
      /&gt;
  &lt;/Form&gt;
  &lt;button type="button" value="send" onClick={(e) =&gt; this.handleSubmit(e)} className={"btn btn-primary"}&gt;Save&lt;/button&gt;
  </code></pre>
  
  <pre><code>handleSubmit(event) {
      const form = event.currentTarget;
      if (form.checkValidity() === false) {
          event.preventDefault();
          event.stopPropagation();
      }
      else
          this.AddProduct();
  
      this.setState({ validated: true });
  }
  </code></pre>