我自己写的聊天室源代码(二)
<%'初始登录页,default.asp%><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<title>登录聊天室</title>
<script language="JavaScript"><!--
function windowload()
{
document.forms[0].T1.focus();
}
function testvalue(tt1)
{
var val;
val = "";
if (tt1 == 1)
{val = document.forms[0].T1.value;}
if (tt1 == 2)
{val = document.forms[0].T3.value;}
return val
}
function msg(tt)
{
alert(tt);
}
function formsubmit()
{
document.forms[0].submit();
}
// --></script>
<script language="VBScript"><!--
function allpass()
dim sc_message,sc_ss,sc_flag
sc_ss = testvalue(1)
sc_flag = 0
if trim(sc_ss) = "" then
sc_flag = 1
sc_message = "必须输入用户名!"
else
sc_ss = testvalue(2)
if trim(sc_ss) = "" then
sc_flag = 1
sc_message = "必须输入口令!"
end if
end if
if sc_flag = 0 then
formsubmit()
else
msg(sc_message)
windowload()
补充:asp教程,高级应用