【发布时间】:2017-03-16 13:53:21
【问题描述】:
我想问一下,这是场景。我有这个多个复选框,但我的问题是每当我勾选一个复选框时,所有 4 个复选框都被选中。还有为什么复选框的值只是真或假。这是我的复选框:
<div className="checkbox">
<label><Field name="investor_stage" component="input" type="checkbox" value="Seed" /> Seed</label>
</div>
<div className="checkbox">
<label><Field name="investor_stage" component="input" type="checkbox" value="Early Stages" /> Early Stages</label>
</div>
<div className="checkbox">
<label><Field name="investor_stage" component="input" type="checkbox" value="Formative Stages" /> Formative Stages</label>
</div>
<div className="checkbox">
<label><Field name="investor_stage" component="input" type="checkbox" value=" Later Stages" /> Later Stages</label>
</div>
【问题讨论】:
-
ReduxForm不支持复选框组。 This 可能会帮助您解决问题。 -
嗨@JyothiBabuAraja你有一个例子如何实现它。我很新反应:D。谢谢!
-
是的,我确实尝试过,但是有一个错误,看起来它使用的是 redux-form 的 v5.5.3 而我使用的是 v6.5.0
-
我也在努力解决这个问题:-),但还没有找到具体的答案。
标签: reactjs redux-form