[求助]这是记录的增加删除问题,新增的记录可以删除,而原有的两行却不能删除.请大家帮忙找一下原因,多谢 ( 积分: 100 )

  • 主题发起人 主题发起人 shanshanhao
  • 开始时间 开始时间
S

shanshanhao

Unregistered / Unconfirmed
GUEST, unregistred user!
<html>
<head>
<title>Untitleddo
cument</title>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
</head>
<SCRIPT language=javascript>
var line=2
function delIt()
{
line=parseInt(event.srcElement.ln,10)

if (line>0)
for (i=1;i<PLList.rows.length;i++)
if (tdt.ln==line)
{
if (do
cument.ecform.medication.value.length>0 )
if (!confirm(&quot;Are you sure you want to delete this record?&quot;))
return
PLList.deleteRow(i)
}
}
function mouseOver()
{
event.srcElement.className=&quot;delMouseOver&quot;
}
function mouseOut()
{
event.srcElement.className=&quot;scheduleButtonVisible&quot;
}
</script>
<body bgcolor=&quot;#FFFFFF&quot;
text=&quot;#000000&quot;>
<form action=rktz6.asp method =&quot;post&quot;>
<TABLE id=fileinput1>
<tr>
<td><input type=&quot;text&quot;
name=&quot;a1&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a2&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a3&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a4&quot;></td>
<td ><input type=&quot;text&quot;
name=&quot;a5&quot;></td>
<td><input type=button value=删除 class=cbutton onClick=&quot;&quot;DelFileInput(1)&quot;&quot;></td></tr></TABLE>
<table id=fileinput2>
<tr>
<td><input type=&quot;text&quot;
name=&quot;a1&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a2&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a3&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a4&quot;></td>
<td ><input type=&quot;text&quot;
name=&quot;a5&quot;></td>
<td><input type=button value=删除 class=cbutton onClick=&quot;&quot;DelFileInput(2)&quot;&quot;></td>
</tr>
</table>
<input type=&quot;button&quot;
name=&quot;add_line&quot;
value=&quot;增加下一行&quot;
onClick=&quot;AddFileInput()&quot;>
<script language=&quot;VBScript&quot;>
NowFileInputNo = 3
NowFileInputCount =2
Sub AddFileInput()
If NowFileInputCount < 10 then
HTMLSrc = &quot;<table Id=FileInput&quot;&amp;
NowFileInputNo &amp;&quot;><tr><td> <input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a1&quot;&quot;></td><td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a2&quot;&quot;></td><td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a3&quot;&quot;></td><td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a4&quot;&quot;></td>&quot;
HTMLSrc = HTMLSrc &amp;
&quot;<td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a5&quot;&quot;><input type=button value=删除 class=cbutton onClick=&quot;&quot;DelFileInput(&quot;&amp;
NowFileInputNo &amp;&quot;)&quot;&quot;></td></tr></table>&quot;&amp;
vbcrlf
do
cument.all.add_line.InsertAdjacentHTML &quot;beforebegin
&quot;, HTMLSrc
NowFileInputNo = NowFileInputNo + 1
NowFileInputCount = NowFileInputCount + 1
else
Alert &quot;增加太多记录行&quot;
End IF
End Sub
Sub DelFileInput(tableno)
do
cument.all(&quot;FileInput&quot;&amp;
tableno).outerHTML = &quot;&quot;
NowFileInputCount = NowFileInputCount - 1
End Sub
</script>
<p><input type=&quot;submit&quot;
value=&quot;提交&quot;
name=&quot;B1&quot;><input type=&quot;reset&quot;
value=&quot;重置&quot;
name=&quot;B2&quot;></p>
</form>
</body>
</html>
 
<html>
<head>
<title>Untitleddo
cument</title>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
</head>
<SCRIPT language=javascript>
var line=2
function delIt()
{
line=parseInt(event.srcElement.ln,10)

if (line>0)
for (i=1;i<PLList.rows.length;i++)
if (tdt.ln==line)
{
if (do
cument.ecform.medication.value.length>0 )
if (!confirm(&quot;Are you sure you want to delete this record?&quot;))
return
PLList.deleteRow(i)
}
}
function mouseOver()
{
event.srcElement.className=&quot;delMouseOver&quot;
}
function mouseOut()
{
event.srcElement.className=&quot;scheduleButtonVisible&quot;
}
</script>
<body bgcolor=&quot;#FFFFFF&quot;
text=&quot;#000000&quot;>
<form action=rktz6.asp method =&quot;post&quot;>
<TABLE id=fileinput1>
<tr>
<td><input type=&quot;text&quot;
name=&quot;a1&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a2&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a3&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a4&quot;></td>
<td ><input type=&quot;text&quot;
name=&quot;a5&quot;></td>
<td><input type=button value=删除 class=cbutton onClick=&quot;&quot;DelFileInput(1)&quot;&quot;></td></tr></TABLE>
<table id=fileinput2>
<tr>
<td><input type=&quot;text&quot;
name=&quot;a1&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a2&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a3&quot;></td>
<td bgcolor=&quot;#FFFFFF&quot;><input type=&quot;text&quot;
name=&quot;a4&quot;></td>
<td ><input type=&quot;text&quot;
name=&quot;a5&quot;></td>
<td><input type=button value=删除 class=cbutton onClick=&quot;&quot;DelFileInput(2)&quot;&quot;></td>
</tr>
</table>
<input type=&quot;button&quot;
name=&quot;add_line&quot;
value=&quot;增加下一行&quot;
onClick=&quot;AddFileInput()&quot;>
<script language=&quot;VBScript&quot;>
NowFileInputNo = 3
NowFileInputCount =2
Sub AddFileInput()
If NowFileInputCount < 10 then
HTMLSrc = &quot;<table Id=FileInput&quot;&amp;
NowFileInputNo &amp;&quot;><tr><td> <input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a1&quot;&quot;></td><td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a2&quot;&quot;></td><td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a3&quot;&quot;></td><td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a4&quot;&quot;></td>&quot;
HTMLSrc = HTMLSrc &amp;
&quot;<td><input type=&quot;&quot;text&quot;&quot;
name=&quot;&quot;a5&quot;&quot;><input type=button value=删除 class=cbutton onClick=&quot;&quot;DelFileInput(&quot;&amp;
NowFileInputNo &amp;&quot;)&quot;&quot;></td></tr></table>&quot;&amp;
vbcrlf
do
cument.all.add_line.InsertAdjacentHTML &quot;beforebegin
&quot;, HTMLSrc
NowFileInputNo = NowFileInputNo + 1
NowFileInputCount = NowFileInputCount + 1
else
Alert &quot;增加太多记录行&quot;
End IF
End Sub
Sub DelFileInput(tableno)
do
cument.all(&quot;FileInput&quot;&amp;
tableno).outerHTML = &quot;&quot;
NowFileInputCount = NowFileInputCount - 1
End Sub
</script>
<p><input type=&quot;submit&quot;
value=&quot;提交&quot;
name=&quot;B1&quot;><input type=&quot;reset&quot;
value=&quot;重置&quot;
name=&quot;B2&quot;></p>
</form>
</body>
</html>
 
后退
顶部