# 校验其他组件 - order: 12 提供以下组件表单域的校验。 `Select` `Radio` `DatePicker` `InputNumber` `Cascader`。 --- ````jsx import { Select, Radio, Button, DatePicker, InputNumber, Form, Cascader } from 'antd'; const Option = Select.Option; const RadioGroup = Radio.Group; const createForm = Form.create; const FormItem = Form.Item; let Demo = React.createClass({ handleReset(e) { e.preventDefault(); this.props.form.resetFields(); }, handleSubmit(e) { e.preventDefault(); this.props.form.validateFields((errors, values) => { if (!!errors) { console.log('Errors in form!!!'); return; } console.log('Submit!!!'); console.log(values); }); }, checkBirthday(rule, value, callback) { if (value && value.getTime() >= Date.now()) { callback(new Error('你不可能在未来出生吧!')); } else { callback(); } }, checkPrime(rule, value, callback) { if (value !== 11) { callback(new Error('8~12之间的质数明明是11啊!')); } else { callback(); } }, render() { const address = [{ value: 'zhejiang', label: '浙江', children: [{ value: 'hangzhou', label: '杭州', }], }]; return (
); }, }); Demo = createForm()(Demo); ReactDOM.render(