How to validate Antd Form and show only red border without error text?

Viewed 509

I have this form: enter image description here

At the moment validation on submit click looks like this: enter image description here

But I need only red border without error text. How can I do that? I need this: enter image description here

Component

 <Form onFinish={handleSubmit} onFinishFailed={onFinishFailed} autoComplete='off'>
...
      <td>
        <Form.Item name='tue'>
          <InputNumberStyled style={{ borderRadius: '10px', width: '60px' }} min={0} max={1000} />
        </Form.Item>
      </td>
...
</Form>
1 Answers

You can try to set the message in the rules property of an antd Form.Item to an empty string.

e.g.:

      <Form.Item
        label="Username"
        name="username"
        rules={[
          {
            required: true,
            message: '',
          },
        ]}
      >
        <Input />
      </Form.Item>

Here is a working stackblitz.

Related