Javascript 如何向react JS中的选项添加验证?
我有一个动态生成的表单,我必须根据在另一个字段中选择的选项为一个字段添加验证Javascript 如何向react JS中的选项添加验证?,javascript,reactjs,validation,formbuilder,react-forms,Javascript,Reactjs,Validation,Formbuilder,React Forms,我有一个动态生成的表单,我必须根据在另一个字段中选择的选项为一个字段添加验证 [{ name: 'Type', label: Labels.Type.id, type: 'select', options: [ 'Date', 'Phone', 'Email', 'Pincode' ], Validations: {
[{ name: 'Type',
label: Labels.Type.id,
type: 'select',
options: [
'Date',
'Phone',
'Email',
'Pincode'
],
Validations: {
required: true,
},
},
{
name: 'Value',
label: Labels.Value.id,
type: 'textbox',
Validations: {
required: true,
},
},
]
在上面的代码片段中,我正在这个模式中生成字段,现在我必须根据在“Type”中选择的值向“Value”添加验证