--- order: 2 title: zh-CN: 典型表单 en-US: Horizontal form --- ## zh-CN 示例展示了如何通过使用 `Form.create` 来获取和更新表单提交的数值。 ## en-US How to use `Form.create` to get and update values of form. ````jsx import { Form, Input, Button, Checkbox, Radio, Tooltip, Icon } from 'antd'; const FormItem = Form.Item; const RadioGroup = Radio.Group; let Demo = React.createClass({ handleSubmit(e) { e.preventDefault(); console.log('Received values of form:', this.props.form.getFieldsValue()); }, render() { const { getFieldDecorator } = this.props.form; const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 14 }, }; return (

Big eye minion

{getFieldDecorator('pass', { initialValue: '' })( )} {getFieldDecorator('gender', { initialValue: 'female' })( male female )} {getFieldDecorator('remark', { initialValue: '' })( )} Sold myself } > {getFieldDecorator('agreement', { initialValue: false, valuePropName: 'checked' })( agree )}
); }, }); Demo = Form.create()(Demo); ReactDOM.render(, mountNode); ````