how to pass argument in onfinish method in antdesign

Solutions on MaxInterview for how to pass argument in onfinish method in antdesign by the best coders in the world

showing results for - "how to pass argument in onfinish method in antdesign"
Sophie
25 May 2019
1import React from 'react';
2
3import { Form, Input, Button } from 'antd';
4
5const FormItem = Form.Item;
6
7class CustomForm extends React.Component {
8
9
10  handleFormSubmit = (values) => {
11    const title = values.title;
12    const content = values.content;
13    console.log(title, content);
14};
15
16  render(){
17    return (
18      <div>
19        <Form onFinish={(values) => this.handleFormSubmit(values)}>
20
21      <FormItem label="Title" name="title">
22        <Input  placeholder="Put a title here" />
23      </FormItem>
24
25      <FormItem label="Content" name="content">
26        <Input  placeholder="Enter some content ..." />
27      </FormItem>
28
29      <FormItem >
30        <Button type="primary"   htmlType="submit">Submit</Button>
31      </FormItem>
32    </Form>
33  </div>
34    );
35  }
36}
37
38export default CustomForm;
39
similar questions