title: How do I implement minimum 5 characters validation in this ant design login form ? I cant find the examples
body: <p>I looked at all the examples of ant.design form but cant find the validation for minimum length for the textboxes. can u please help?</p>
  
  <p><a href="https://ant.design/components/form/?locale=en-US#header" rel="noreferrer">https://ant.design/components/form/?locale=en-US#header</a></p>
  
  <p><a href="https://codesandbox.io/s/pww70x7y6q" rel="noreferrer">https://codesandbox.io/s/pww70x7y6q</a></p>
  
  <pre><code>import { Form, Icon, Input, Button, Checkbox } from 'antd';
  
  class NormalLoginForm extends React.Component {
    handleSubmit = e =&gt; {
      e.preventDefault();
      this.props.form.validateFields((err, values) =&gt; {
        if (!err) {
          console.log('Received values of form: ', values);
        }
      });
    };
  
    render() {
      const { getFieldDecorator } = this.props.form;
      return (
        &lt;Form onSubmit={this.handleSubmit} className="login-form"&gt;
          &lt;Form.Item&gt;
            {getFieldDecorator('username', {
              rules: [{ required: true, message: 'Please input your username!' }],
            })(
              &lt;Input
                prefix={&lt;Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} /&gt;}
                placeholder="Username"
              /&gt;,
            )}
          &lt;/Form.Item&gt;
          &lt;Form.Item&gt;
            {getFieldDecorator('password', {
              rules: [{ required: true, message: 'Please input your Password!' }],
            })(
              &lt;Input
                prefix={&lt;Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} /&gt;}
                type="password"
                placeholder="Password"
              /&gt;,
            )}
          &lt;/Form.Item&gt;
          &lt;Form.Item&gt;
            {getFieldDecorator('remember', {
              valuePropName: 'checked',
              initialValue: true,
            })(&lt;Checkbox&gt;Remember me&lt;/Checkbox&gt;)}
            &lt;a className="login-form-forgot" href=""&gt;
              Forgot password
            &lt;/a&gt;
            &lt;Button type="primary" htmlType="submit" className="login-form-button"&gt;
              Log in
            &lt;/Button&gt;
            Or &lt;a href=""&gt;register now!&lt;/a&gt;
          &lt;/Form.Item&gt;
        &lt;/Form&gt;
      );
    }
  }
  
  const WrappedNormalLoginForm = Form.create({ name: 'normal_login' })(NormalLoginForm);
  
  ReactDOM.render(&lt;WrappedNormalLoginForm /&gt;, mountNode);
  </code></pre>
  
  <p>How do I implement minimum 5 characters validation in this ant design login form ? I cant find the examples.</p>