Answers for "how to pass argument in onFinish method in antdesign"

0

how to pass argument in onFinish method in antdesign

import React from 'react';

import { Form, Input, Button } from 'antd';

const FormItem = Form.Item;

class CustomForm extends React.Component {


  handleFormSubmit = (values) => {
    const title = values.title;
    const content = values.content;
    console.log(title, content);
};

  render(){
    return (
      <div>
        <Form onFinish={(values) => this.handleFormSubmit(values)}>

      <FormItem label="Title" name="title">
        <Input  placeholder="Put a title here" />
      </FormItem>

      <FormItem label="Content" name="content">
        <Input  placeholder="Enter some content ..." />
      </FormItem>

      <FormItem >
        <Button type="primary"   htmlType="submit">Submit</Button>
      </FormItem>
    </Form>
  </div>
    );
  }
}

export default CustomForm;
Posted by: Guest on June-23-2021

Code answers related to "how to pass argument in onFinish method in antdesign"

Code answers related to "Javascript"

Browse Popular Code Answers by Language