javascript转vbscript
来源:百度知道 编辑:UC知道 时间:2024/09/21 20:25:35
<html>
<head>
<title>聊天室</title>
<Script Language="JavaScript">
<!--
function check_Null(){
if (document.form1.user_name.value==""){
alert("昵称不能为空!");
return false;
}
return true;
}
// -->
</Script>
</head>
<body >
<h2 align="center">小小聊天室</h2>
<center>
现在共有<%=Application("user_online")%>人在线<p>
<form method="post" action="chat.asp" name="form1" onsubmit="JavaScript: return check_Null();">
请输入昵称<input type="text" nam
<head>
<title>聊天室</title>
<Script Language="JavaScript">
<!--
function check_Null(){
if (document.form1.user_name.value==""){
alert("昵称不能为空!");
return false;
}
return true;
}
// -->
</Script>
</head>
<body >
<h2 align="center">小小聊天室</h2>
<center>
现在共有<%=Application("user_online")%>人在线<p>
<form method="post" action="chat.asp" name="form1" onsubmit="JavaScript: return check_Null();">
请输入昵称<input type="text" nam
终于搞定了
再改成这样试试吧:
<html>
<head>
<title>聊天室</title>
<Script Language="VBScript">
<!--
Function form1_onSubmit()
if (document.form1.user_name.value="") then
msgbox("昵称不能为空!")
form1_onSubmit = false
else
form1_onSubmit = true
end if
End function
// -->
</Script>
</head>
<body >
<h2 align="center">小小聊天室</h2>
<center>
现在共有<%=Application("user_online")%>人在线<p>
<form method="post" action="chat.asp" name="form1">
请输入昵称<input type="text" name="user_name" size="10">
<input name="Submit" type="Submit" value=" 进 入 ">
</form>
</center>
</body>
</html>
纳闷,