0

I want my input to show error message when symbols or numbers entered. but when i enter symbols and numbers with letters it won't show the error message. what is the reason for it ?

               <Form.Item {...formItemLayout} label="Name">
                    {getFieldDecorator('name',{
                            rules: [
                                {
                                  pattern:'[a-zA-Z\s]+',
                                  message: 'The input is not a valid',
                                }
                              ],
                        })(
                            <Input
                            name="name"
                        />
                        )

                        }

             </Form.Item>

enter image description here

enter image description here

123t
  • 77
  • 1
  • 10

0 Answers0