我有引导数据表,我正在使用百里香叶动态绑定值。 因为我的一列是单选按钮。如何确保在用户提交表单时仅选择一行或一个单选按钮。目前,它允许用户同时选择多个单选按钮/行。引导数据库本身中是否有任何现成的此类选项。我正在使用数据表-1.10.9
<table id="testTable" class="table table-striped table-bordered">
<thead>
<tr>
<th scope="col">Select</th>
<th scope="col">BookingId</th>
<th scope="col">Source</th>
<th scope="col">Destination</th>
<th scope="col">Trip Start Date</th>
<th scope="col">Status</th>
</tr>
</thead>
<tbody>
<tr data-th-each="booking : ${mybookings}">
<td><input typr="radio" th:value="${booking.id}"></input></td>
<td data-th-text="${booking.source}"></td>
<td data-th-text="${booking.destination}"></td>
<td data-th-text="${booking.tripStartTime}"></td>
<td data-th-text="${booking.statusMaster.statusName}"></td>
</tr>
</tbody>
</table>
这已经在另一篇文章中得到了回答,他们在单选按钮中添加了一个 name 属性,因此每组按钮只选择一个按钮:
[如何设置只能检查一个单选按钮