日期:2014-05-18 浏览次数:20656 次
<table width="100%" id="tb" class="table_2r" cellpadding="0" cellspacing="0">
<colgroup>
<col style="width: 80%" />
<col style="width: 20%" />
</colgroup>
<s:iterator value="#request.tbImgSelectedItem" var="tb" status="sta">
<tr>
<td>
<input type="hidden" class="tbImgSelectedItem" name="" value='${tb.id}' />
(<span class="table_line_num"><s:property value="#sta.index+1"/></span>)
<input type="text" id="itemName" class="table_input" name="" value='${tb.item}' />
</td>
<td class="y_n">
<input type="radio" name='A' value="是" />
<span>是</span>
<input type="radio" name='A' value="否" />
<span>否</span>
<img src="../images/delete_line.png" class="del_line fn-right" />
</td>
</tr>
</s:iterator>
</table>
<script>
//添加行
$("#add_table_line_selected").click(function() {
var add_line_content = $(this).parent().siblings("table").find("tr:last");
var change_table = $(this).parent().siblings("table");
//add_line_content.clone(true).addClass("normal_input").appendTo(change_table).find(".table_input").val("");
add_line_content.clone(true).addClass("normal_input").appendTo(change_table).find(".tbImgSelectedItem").val("");
change_table.find(".table_input:last").val("");
$("table tr").each(function() {
var num = $(this).index();
var realnum = num + 1;
$(this).find(".table_line_num").html(realnum);
})
})
</script>