I have two pages addressForm.js and index.js. In addressForm.js page the code for Form is written. Sample code shown below.
<Col >
<div style={{'height': '45px','display':'flex'}}>
<label style={{'color': '#f5222d', 'paddingTop': '10px','fontFamily': 'SimSun'}}>*</label>
<label style={{'width':'74px','paddingTop':'8px'}}>Customer Name:</label>
<FormItem >
{getFieldDecorator('Name', {
initialValue: '',
rules: [{
required: true,
message: (
<Tooltip
visible={true} placement="topRight"
title="Please Input Customer Name"
/>
),
}],
})(
<Input placeholder="Customer Name" style={{'width':'164px'}} onChange={(e)=>{e.preventDefault(); e.stopPropagation();
this.handleChange(0,e, 'Name')}}/>
)}
</FormItem>
</div>
</Col>
In the index.js page fuctions for the form is written (What to happen when the Submit button is clicked). Sample Code:
handleOk = () => {
this.props.form.validateFields((err, values) => {
if (!err) {
/* Code.......*/
}
});
}
The problem is that the validation is not working (ie.,validation checking is not done and I am getting this error).
Shall I import anything in index.js page to avoid the error?