mulitcheckbox:我只能检查一个复选框
网格单元格中显示 2 个复选框。我只能选中一个复选框。如果我点击另一个,它会检查第一个。如何激活另一个复选框。 这是我的 html:
<div class="inline-div" *ngFor="let item of to.labels | keyvalue; let idx=index">
<input type="checkbox" id="item{{item.value}}">
<label class="form-check-label" for="item{{item.value}}">{{item.value.value}}</label>
</div>
请建议如何确保选中另一个复选框。
There are 2 checkboxes displayed in a grid cell. I am able to check only one checkbox. If I click on the another, it' checking the first one. How to make the other checkbox active.
here is my html:
<div class="inline-div" *ngFor="let item of to.labels | keyvalue; let idx=index">
<input type="checkbox" id="item{{item.value}}">
<label class="form-check-label" for="item{{item.value}}">{{item.value.value}}</label>
</div>
Please suggest how to make sure the other checkbox is been checked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
id 不是动态生成的。所以两个复选框的 id 是相同的。这就是为什么只有一个复选框起作用。
id was not getting generated dynamically. So id's for both the checkbox were same. That's why only one checkbox were working.