【发布时间】:2018-10-17 15:15:15
【问题描述】:
<#if userDatas?? >
<form action="remove-list" method="POST" autocomplete="on" class="form-horizontal" role="form" id="form1">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th class="minwidth">select All <input type="checkbox" onchange="checkAll(this)"> </th>
<th>roll no</th>
<th>name</th>
<th>Created date</th>
<th>modified date</th>
</tr>
</thead>
<tbody>
<#list userDatas as userData>
<tr>
<td class="centered-simple"><input type="checkbox" name="entries" value="${userData.roll}" id="${userData.roll}" ></td>
<td>${(userData.roll)!notset}</td>
<td>${(userData.name)!notset}</td>
<td>${(userData.whenCreated?datetime)!notset}</td>
<td><code>${(userData.whenModified?datetime)!notset}</code></td>
</tr>
</#list>
</tbody>
</table>
<div class="btn-group btn-group-tss">
<button type="submit" class="btn btn-primary">
<span class="glyphicon glyphicon-search"></span> Delete selected
</button>
</div>
</form>
</#if>
在上面的代码sn-p中,我有一个表格,标题为全选、角色、名称、创建日期和修改日期。
当我点击 Delete selected 按钮时,显然 userdata.roll 值将被发送。
这里我想在单击复选框时同时发送 userdata.roll 和 userdata.name。
我试过了,但没有成功。
请帮助我如何在选中复选框时发送这两个值。
PS : 我正在使用 FTL 编码。
【问题讨论】:
标签: html checkbox html-table freemarker