【发布时间】:2011-06-19 08:47:41
【问题描述】:
另一个复选框问题。我在列表中有项目。每个项目都有一个复选框。我想要做的是在列表中勾选 FIRST 项目的复选框。没错,因为checked="checked",它已经勾选了所有的复选框。
{% for item in items %}
<tr class="items_table_row">
<td><input type="checkbox" name="{{item.pk}}" value="{{item.pk}}" checked="checked"></td>
<td>{{item.tiptop_id}}</td><td>{{item.alternative_id}}</td><td>{{item.title}}</td><td>{{item.type}}</td><td>{{item.format}}</td>
<td><span id="{{item.pk}}" name="type">{{item.itemstatushistory_set.latest}}</span></td><td>{{item.itemstatushistory_set.latest.date.date|date:"d M Y"}}</td>
<td><a href="{% url tiptop.views.edit_item item.client.pk item.pk %}" onclick="return showAddAnotherPopup(this);">Edit</a></td>
</tr>
{% endfor %}
【问题讨论】:
标签: python html django checkbox views