谢谢各位:
我通过表单的隐藏值解决了这问题。
将源码供大家参考。同时请教更好的办法。
<script language="vbscript">
<!--
function ls(ok)
if not confirm("aaaaaaaaaaaaaaaaa"+"?") then
form.aaa.value=false
else
form.aaa.value=true
end if
end function
'msgbox "aaaa"&ls()&"bbbbbbbb"
--></script>
<body>
<% if request("b1")="提交" then
if request("aaa") then
response.write request("t1") 这可以换上处理删除的asp 语句。
end if
end if%>
<form method="POST" action="sample.asp" onsubmit="ls(ok)" name="form" >
<p><input type="text" name="T1" size="20"></p>
<p><input type="submit" value="提交" name="B1"><input type="reset" value="全部重写" name="B2"></p>
<input type="hidden" name="aaa" value="true">
</form>
</body>
<Script Language="Vbscript">
<!--
Sub Confirmdelete()
Dim Key
Key=Msgbox("<%=Mess%>",4,"<%=Titl%>")
If Key=Vbyes Then
Else
End If
End Sub
//-->
</Script>
</Head>
<body>
<Input Type="Button" Name="Button" Value="删除文件" Onclick="Confirmdelete">
</body>
</Html>
<Script Language="Vbscript">
<!--
Sub Confirmdelete()
Dim Key,T1,T2
Key=Msgbox("<%=Mess%>",4,"<%=Titl%>")
If Key=Vbyes Then
Else
End If
End Sub
//-->
</Script>
</Head>
<Input Type="Button" Name="Button" Value="删除文件" Onclick="Confirmdelete">
html>
....
<Script LANGUAGE="VBScript">
<!--
Sub ConfirmDelete()
Dim key
<%response.write "key=MsgBox("& mess &",vbyesno,"& titl &")"%> '注意这里
If key=VBYes Then
.... '这里的语句要用asp处理,但这不能用 <% %> ASP语句
Else
.... '这里的语句要用asp处理,但这不能用 <% %> ASP语句
End If
End Sub
--//>
</Script>
<html>
....
<Script LANGUAGE="VBScript">
<!--
Sub ConfirmDelete()
Dim key
<%response.write "key=MsgBox("& mess &",vbyesno,"& titl &")"%> '注意这里
If key=VBYes Then
....
Else
....
End If
End Sub
--//>
</Script>