title: how to add dynamic validation in form using reactjs
body: <p>I am using <code>ant design</code> in my demo application. I want to add <code>dynamic validation</code> of mobile number in my application.</p>
  
  <p>In my form there two field </p>
  
  <ol>
  <li>select field</li>
  <li>input field</li>
  </ol>
  
  <p>I want to add validation in the input field when <code>select field</code> in <code>mobile</code>(mobile number should be 10 digits).in other words I want to add validation of <strong>mobile number on input field</strong> only when user select  <code>mobile</code> from select box</p>
  
  <p><a href="https://ant.design/components/form/" rel="nofollow noreferrer">https://ant.design/components/form/</a></p>
  
  <p>here is my code
  <a href="https://codesandbox.io/s/holy-voice-o4wbj" rel="nofollow noreferrer">https://codesandbox.io/s/holy-voice-o4wbj</a></p>
  
  <pre><code>&lt;Form.Item&gt;
            {getFieldDecorator("value", {
              rules: [
                { required: true, message: "Please input search value!" },
                { pattern: /[2-9]{2}\d{8}/, message: "Please input !" }
              ]
            })(
              &lt;Input
                style={{ width: 180 }}
                // prefix={&lt;Icon type="user" style={{color: 'rgba(0,0,0,.25)'}}/&gt;}
                placeholder="searchValue"
              /&gt;
            )}
          &lt;/Form.Item&gt;
  </code></pre>
  
  <p>can we add this validation ?</p>