Why ';' is missing in my code?

masterz 2000-06-24 09:28:00
I use Javascript in one of my ASP page to validate data post by a form, but a strange error make puzzled. The code is as following:
function ValidateUserRegInfo(form)
{

if (form.email.value < " " and and form.loginname.value < " " and and form.password.value < " " and and form.password2.value < " " )
{
alert("Fields marked with * are required. Please fill out all required fields before submitting.");
return false;
}
if (form.email.length<2)
{
alert("email can not be void");
return false;
}
if (form.password.value!=form.password2.value)
{
alert("You have entered two unidentical string for password");/* It always say this line missing ';',even after I comment out this line!*/
return false;
}
string loginname=form.loginname.value;
char ch;
int name-ok=0;
alert(loginname);
for(int i=0 ;i<loginname.length,i++)
{
name-ok=0;
ch=loginname.charat(i);
if(ch='.' and and ch='_' and and ch='+' and and ch='-' and and ch='~' )
name-ok=1;
if ((ch<'z' && ch>'a' ) and and (ch<'Z'&&ch>'A') and and (ch>'0' &&ch<'9'))
name-ok=1;
if (name-ok==0)
{
alert("login name can only use 'A'~'Z' or 'a'~'z' or '0'~'9' or '.','-','+'");
return false;
}
}
return true;
}
...全文
90 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
masterz 2000-06-25
  • 打赏
  • 举报
回复
The "and and" is replaced by the forum server , in fact I use two "or" operator! Now I have find the problem: for Java is case sensitive.
TopHead 2000-06-24
  • 打赏
  • 举报
回复
if (form.email.value < " " and and form.loginname.value < " " and and form.password.value < " " and and form.password2.value < " " )

中的and换成&&,试试!

28,390

社区成员

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

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