A
A
arishaYako_142020-11-09 15:00:51
React
arishaYako_14, 2020-11-09 15:00:51

Why can't form validation work in ant design?

Hi everyone, I have a spreadsheet with forms to fill out. I need a mandatory validation. For some reason rules={[{required: true}]} doesn't work. Maybe the problem is that they are in a table? The idea is something like this:

const columns = [
{
  title: 'Document number',
  key: 'docNumber',
  render:
    return(
      <Form>
        <Form.Item rules={[{required: true}]}>
          <Input name='docNumber'/>
        </Form.Item>
      </Form>
    )
 }
];

<Table 
  columns={columns}
/>

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question