你要用location来变更地址,就不要使submit启作用
<script language="javascript">
function del()
{
if(confirm("你确实要删除吗?"))
{
window.location.href="delzxxw.asp";
}
else
{
window.location.href="admin.asp";
}
return false;
}
</script>
<form id="form" name="form" method="post">
<table width="518" border="0" cellspacing="0">
<tr>
<td width="320">请输入需要删除的新闻ID:
<input name="text" type="text" size="10" maxlength="4" /> </td>
<td width="194"> <input type="submit" name="Submit" value="提 交" onclick="return del()" /> </td>
</tr>
</table>
</form>
<script language="javascript">
function del()
{
if(confirm("你确实要删除吗?"))
{
window.location.href="delzxxw.asp";
}
else
{
window.location.href="admin.asp";
}
return false;
}
</script>
<form id="form" name="form" method="post">
<table width="518" border="0" cellspacing="0">
<tr>
<td width="320">请输入需要删除的新闻ID:
<input name="text" type="text" size="10" maxlength="4" /> </td>
<td width="194"> <input type="submit" name="Submit" value="提 交" onclick="return del()" /> </td>
</tr>
</table>
</form>
...
<form id="form" name="form" method="post">
<table width="518" border="0" cellspacing="0">
<tr>
<td width="320">请输入需要删除的新闻ID:
<input name="text" type="text" size="10" maxlength="4" /> </td>
<td width="194"> <input type="button" name="Submit" value="提 交" onclick="return del()" /> </td>
</tr>
</table>
</form>
return del()这样的话就需要del()有个返回值