【发布时间】:2017-09-19 07:20:14
【问题描述】:
我有一个表单,我想在一个字段上显示一个验证错误(作为用户的信息),但我不希望这个错误阻止提交表单。
我会很感激任何提示,如何做到这一点......
---编辑---
我被要求提供一个例子。请以 redux-form 提供的 this 为例:http://redux-form.com/6.6.1/examples/fieldlevelvalidation/
<Field name="username" type="text"
component={renderField}
label="Username"
validate={[ required, maxLength15 ]}
/>
这里有 2 个验证函数:required 和 maxLength15。即使maxLength15 返回错误消息,我也希望允许用户提交表单。我想显示消息但允许表单提交
【问题讨论】:
-
请举个例子
标签: redux-form