动态增加 table JAVAScript
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include le="/WEB-INF/common/taglibs.jsp"%>
<script type="text/javascript">
function addMedalsSet(targetdl,sourceDiv){
var oTBODY =
document.getElementById(targetdl).tBodies.item(0);
var oTBODYData =
document.getElementById(sourceDiv).tBodies.item(0);
var rowsCount = oTBODYData.rows.length;
for(var i=0;i<rowsCount;i++){
oTBODY.appendChild(oTBODYData.rows[i].cloneNode(true));
}
}
function getMedalsGroup(){
var
medalsCodeList=document.getElementsByName("appMedalsIn
fo.id");
var index = medalsCodeList.selectedIndex;
var value = medalsCodeList.options[index].value;
alert(value);
var str="";
for(var i=0;i<medalsCodeList.length && list[i];i++){
str +=list[i].value;
alert(str);
}
}
</script>
<html><body>
<div class="pageContent">
<form method="post" action="${ctx}/appPrizeInfo/add.do?
navTabId=userLiNav" class="pageForm required-validate"
onsubmit="return
validateCallback(this,dialogReloadNavTab);">
<div class="pageFormContent" layoutH="56">
<input type="hidden" name="medalsGroup"
value="getMedalsGroup();">
<table id="sourceTable" style="display:none;">
<tbody>
<tr>