一个confirm的问题

redtank2000 2004-11-29 11:16:48
下面代码怎么修改好?
如果点是则提交,点否则转页面。
onsubmit="return check();"
function check(){
if (confirm('您配置了吗?')){
return true;

}else{
window.location=server.asp';


}

}
...全文
145 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
redtank2000 2004-11-29
  • 打赏
  • 举报
回复
谢谢了
xhust2000 2004-11-29
  • 打赏
  • 举报
回复
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>

<BODY>
<script>
function check(){
if (confirm('您配置了吗?')){
document.form.action="?.asp";
document.form.submit();

}else{
window.location='server.asp';


}
}
</script>
<input type=button onclick="check()" value="测试">
</BODY>
</HTML>
ygjwjj 2004-11-29
  • 打赏
  • 举报
回复
<form name="kk" action="save.asp" onsubmit="return check();">


<script >

function check(){
if (confirm('您配置了吗?')){
return true;

}else{
window.location=server.asp;


}

}

</script>
alern_zyb 2004-11-29
  • 打赏
  • 举报
回复
onsubmit="check();"
function check(){
if (confirm('您配置了吗?')){
form.submit();

}else{
window.location.href='server.asp';


}

}
sdts 2004-11-29
  • 打赏
  • 举报
回复
window.location---->window.location.href

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧