狂菜的问题;提示有错》我好急啊啊

yedapeng 2003-12-27 01:14:22
页面上有两个文本筐;和一个按扭;代码在下面
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body><script language="VBScript" runat =server>
if form1.name="" then
msgbox "cccc"
endif

</script>
<form name="form1" method="post" action="">
<p>name:
<input type="text" name="name">
</p>
<p>password:
<input type="text" name="password">
<input type="submit" name="tijiao" value="提交">
</p>
</form>
</body>
</html>
...全文
35 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wdclub 2003-12-27
  • 打赏
  • 举报
回复
如果不用检测是否为空,就用下面的吧。
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="">
<p>name:
<input type="text" name="name">
</p>
<p>password:
<input type="text" name="password">
<input type="button" name="tijiao" value="提交" onClick="return check();">
</p>
</form>
</body>
</html>
x_gn 2003-12-27
  • 打赏
  • 举报
回复
asp 中是没有 runat =server的,去掉它,还有服务器端不支持msgbox 函数
需要弹出窗口用javascript的alert()
潜水的鱼 2003-12-27
  • 打赏
  • 举报
回复
你的代码很不完整
帮你写一个
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<script language="VBScript" runat =server>
sub checkmsg
if form1.name.value="" then
msgbox "cccc"
elseif form1.password.value="" then
msgbox "请填密码"
else
form1.submit
end if
end sub
</script>
'-------------------------------------------
<form name="form1" method="post" action="">
<p>name:
<input type="text" name="name">
</p>
<p>password:
<input type="text" name="password">
<input type="button" name="tijiao" value="提交" onclick=checkmsg>
</p>
</form>
</body>
</html>
youxuesifang 2003-12-27
  • 打赏
  • 举报
回复
把文本框的名字改一改试试
box526 2003-12-27
  • 打赏
  • 举报
回复
是end if不是endif

28,406

社区成员

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

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