你可以针对上面的三个功能进行测试。如果有未考虑周全的地方还希望朋友们及时的提出来。谢谢!
查看代码
查看代码
实现的代码如下:
<html>
<head>
<meta http-equiv="content-type" content="text/html">
<title>locale photo</title>
<script>
function AddMoreRow()
{
var oRow=event.srcElement.parentNode.parentNode;
var oTable=oRow.parentNode.parentNode;
oNewRow=oTable.insertRow();
for(i=0;i<oRow.cells.length;i++)
{
oNewRow.insertCell().innerHTML=oRow.cells[i].innerHTML;
}
oRow.all("DelBtn").disabled=false;
oNewRow.all("DelBtn").disabled=false;
}
function DeleteMoreRow()
{
var oRow=event.srcElement.parentNode.parentNode;
var oTable=oRow.parentNode.parentNode;
if(oTable.rows.length>1)
{
oTable.deleteRow(oRow.rowIndex);
if(oTable.rows.length==1)
{
oTable.all("DelBtn").disabled=true;
}
}
}
function DisabledKeyInput()
{
if(event.keyCode!=8&&event.keyCode!=46)
{
event.returnValue=false;
}
}
</script>
</head>
<body topmargin="10">
<form method="post" enctype="multipart/form-data">
<table><th>批量上传</th></table>
<table>
<tr>
<td nowrap="nowrap">名称*</td>
<td><input type="text" name="Name" size="15" maxlength="50"></td>
<td nowrap="nowrap">文件路径*</td>
<td><input type="file" name="FilePath" size="15" onKeyDown="DisabledKeyInput()" /></td>
<td nowrap="nowrap">说明*</td>
<td><input type="text" name="Description" size="45"><input type="button" value="增加" onclick="AddMoreRow()"></td>
<td nowrap="nowrap">
<input type="button" id="DelBtn" value="删除" disabled="disabled" onClick="DeleteMoreRow()">
</td>
</tr>
</table>
<table>
<tr align="center">
<td align="center">
<input type="submit" value="保存"> <input type="reset" value="取消"></td>
</tr>
</table>
</form>
</body>
</html>
<head>
<meta http-equiv="content-type" content="text/html">
<title>locale photo</title>
<script>
function AddMoreRow()
{
var oRow=event.srcElement.parentNode.parentNode;
var oTable=oRow.parentNode.parentNode;
oNewRow=oTable.insertRow();
for(i=0;i<oRow.cells.length;i++)
{
oNewRow.insertCell().innerHTML=oRow.cells[i].innerHTML;
}
oRow.all("DelBtn").disabled=false;
oNewRow.all("DelBtn").disabled=false;
}
function DeleteMoreRow()
{
var oRow=event.srcElement.parentNode.parentNode;
var oTable=oRow.parentNode.parentNode;
if(oTable.rows.length>1)
{
oTable.deleteRow(oRow.rowIndex);
if(oTable.rows.length==1)
{
oTable.all("DelBtn").disabled=true;
}
}
}
function DisabledKeyInput()
{
if(event.keyCode!=8&&event.keyCode!=46)
{
event.returnValue=false;
}
}
</script>
</head>
<body topmargin="10">
<form method="post" enctype="multipart/form-data">
<table><th>批量上传</th></table>
<table>
<tr>
<td nowrap="nowrap">名称*</td>
<td><input type="text" name="Name" size="15" maxlength="50"></td>
<td nowrap="nowrap">文件路径*</td>
<td><input type="file" name="FilePath" size="15" onKeyDown="DisabledKeyInput()" /></td>
<td nowrap="nowrap">说明*</td>
<td><input type="text" name="Description" size="45"><input type="button" value="增加" onclick="AddMoreRow()"></td>
<td nowrap="nowrap">
<input type="button" id="DelBtn" value="删除" disabled="disabled" onClick="DeleteMoreRow()">
</td>
</tr>
</table>
<table>
<tr align="center">
<td align="center">
<input type="submit" value="保存"> <input type="reset" value="取消"></td>
</tr>
</table>
</form>
</body>
</html>