62,046
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="utf-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script language="javascript" type="text/javascript">
function numSet()
{
var num_1=document.getElementById("Num_1").value;
var num_1_str=document.getElementById("num_1_str");
var str;
str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
for(var i=0;i<num_1;i++)
{
str=str+"<tr><td height='28px'>";
str=str+"属性名称:<input name='attribute"+(parseInt(i)+1)+"' type='text' id='attribute"+(parseInt(i)+1)+"' size='18' /> 属性值:<input name='attribute"+(parseInt(i)+1)+"_value' type='text' id='attribute"+(parseInt(i)+1)+"_value' size='50' /></td>";
str=str+"</tr>";
}
str=str+"</table>";
num_1_str.innerHTML=str;
}
function numAdd()
{
var num_1=document.getElementById("Num_1").value;
var num_1_str=document.getElementById("num_1_str");
var str;
str="<table width='100%' border='0' cellspacing='0' cellpadding='0'>";
str=str+"<tr><td height='28px'>";
str=str+"属性名称:<input name='attribute"+(parseInt(num_1)+1)+"' type='text' id='attribute"+(parseInt(num_1)+1)+"' size='18' /> 属性值:<input name='attribute"+(parseInt(num_1)+1)+"_value' type='text' id='attribute"+(parseInt(num_1)+1)+"_value' size='50' /></td>";
str=str+"</tr>";
str=str+"</table>";
num_1_str.innerHTML=num_1_str.innerHTML+str;
document.getElementById("Num_1").value=(parseInt(num_1)+1);
}
</script>
</head>
<body>
<input name="Num_1" type="text" id="Num_1" value="0" size="5" />个
<input type="button" name="buttonSet" id="buttonSet" value="设置" onClick="numSet()" />
<input type="button" name="buttonAdd" id="buttonAdd" value="增加一个" onClick="numAdd()" />
<br /><span id="num_1_str"></span>
</body>
</html>