是否可以通过单击按钮将字段验证设置为true或false?还是仅在按钮动作和模糊时才将自定义验证传递给该字段的方法?
我想在单击按钮时进行自定义字段验证。我需要通过一些API调用来验证输入的值。我将在场模糊和按钮单击中使用此新验证。
我找不到实现这一目标的线索。可以请一些建议我。
<Field name={`${name}.complete`}
label="Australian postal address"
placeholder={this.props.placeholder}
component={NewTextInput}
onChange={this.triggerAutoSuggest.bind(this)}
onkeypressfun={this.triggerKeyevent.bind(this)}
showspinner={this.state.showspinner}
onBlur={this.validateAddressfun.bind(this)}
ref="autocompletefiled"
autoComplete="nope"
type="text"
validate={[requiredGeneric]}
/>
<button onClick={this.validateField}>validate Filed value</button>
如果您可以建议一些解决方法,对我也可以。