<html>
<head>
<title></title>
</head>
<form name="domainForm" method="post">
<table border="1" bordercolor="#7FB0DE" bordercolordark="#ffffff" cellpadding="1" cellspacing="0" class="content01" width="100%">
<tr>
<td width="10%" align="right" nowrap="nowrap">付款条件:</td>
<td colspan="3">
<div id="file1"> </div>
<input name="count_pay" id="count_pay" type="hidden" />
<input name="xiyaoname" id="1" value="添加付款条件" type="button" οnclick="Add(1);" />
</td>
</tr>
</table>
</form>
<script type="text/javascript">
var count = 0;
function Add(num){
count += 1;
var File1 = document.getElementById("file1");
var div = document.createElement("div");
var countTxt = document.createTextNode("条件"+count+"→ ");
var countTxt1 = document.createTextNode(" 日期:");
var countTxt2 = document.createTextNode(" 金额:");
var inputTxt_date = document.createElement("input");
inputTxt_date.type = "text";
inputTxt_date.value = "";
inputTxt_date.name = "paydate_"+count;
var inputTxt_money = document.createElement("input");
inputTxt_money.type = "text";
inputTxt_money.value = "";
inputTxt_money.name = "paymoney_"+count;
var btn = document.createElement("input");
btn.type = "button";
btn.value = "删除";
btn.onclick = function()
{
this.parentNode.parentNode.removeChild(this.parentNode);
var n = File1.getElementsByTagName("div");
for(var k=0; k<n.length; k++)
{
n[k].firstChild.nodeValue = "条件"+(k+1)+"→ ";
n[k].firstChild.nextSibling.nextSibling.name = "paydate_"+(k+1);
n[k].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.name = "paymoney_"+(k+1);
}
count -= 1;
document.getElementById("count_pay").value=count;
}
div.appendChild(countTxt);
div.appendChild(countTxt1);
div.appendChild(inputTxt_date);
div.appendChild(countTxt2);
div.appendChild(inputTxt_money);
div.appendChild(btn);
File1.appendChild(div);
document.getElementById("count_pay").value=count;
}
</script>
</body>
</html>