时间:2021-07-01 10:21:17 帮助过:13人阅读
</table>
</body>
<script language=javascript>
function save(){
if(!confirm("确实要保存并转入下一步吗?")){
return;
}
getInfo();
//qy_info.submit();
}
function addRow(){
//添加一行
var newTr = document.getElementById("tbl_gd").insertRow(-1);
var index=newTr.rowIndex;
//alert(index);
//添加四列
var newTd0 = newTr.insertCell(-1);
var newTd1 = newTr.insertCell(-1);
var newTd2 = newTr.insertCell(-1);
var newTd3 = newTr.insertCell(-1);
//设置列内容和属性
newTd0.innerHTML ="<input name=\"name"+index+"\" id=\"name"+index+"\" value=\"\">";
newTd1.innerHTML = "<input name=\"cardNo"+index+"\" id=\"cardNo"+index+"\" value=\"\">";
newTd2.innerHTML = "<input name=\"moneyInvested"+index+"\" id=\"moneyInvested"+index+"\" value=\"\">";
newTd3.innerHTML = "<input name=\"percentage"+index+"\" id=\"percentage"+index+"\" value=\"\">";
}
function delRow(){
if(document.getElementById("tbl_gd").rows.length>2){
document.getElementById("tbl_gd").deleteRow(-1);
}
}
function getInfo(){
var infoStr="";
alert(name2.value);
alert(tbl_gd.rows.length);
for(var i=1;i<=tbl_gd.rows.length-1;i++){
infoStr+=document.all.item("name"+i).value+"::";
infoStr+=document.all.item("cardNo"+i).value+"::";
infoStr+=document.all.item("moneyInvested"+i).value+"::";
infoStr+=document.all.item("percentage"+i).value+";;";
}
alert(infoStr);
}
</script>
</html>