请将下面的代码,插入您的网页:
<script language="JavaScript">
function enter()
{
if(validname(document.form1.elements[0])){
document.form1.submit();
}
}
function validname(str1)
{
if (str1.value.length <1) {
alert("请输入您的大名,名字不能为空!");
str1.focus();
return false;
}
str=str1.value.toString();
if( ((str.search("#")!=-1)||(str.search('&')!=-1))){
alert("名字中不能包含特殊字符: # & .");
str1.focus();
return false;
}
return true;
}
</script>
<form action=http://202.96.140.86/cgi-bin/login.cgi method=post name=form1>
用户:<input type="text" name="USER" size="8" maxlength="15">
<p>密码(已注册用户)<input type="password" name="PASS" size="8" maxlength="15">
<input name="roomid" type="hidden" value="346746">
<input type="button" value="点击进入" onClick=enter() name="button2"> </p>
</form><span style="font-size: 9pt"><a href="http://chat.yinsha.com/zc.htm">
新用户注册</a></span></td>
效果:
新用户注册