asp网站制作的问题

来源:百度知道 编辑:UC知道 时间:2024/06/17 15:21:40
我是新手学做ASP的,做了一个注册页面,可以注册了,单身用户名空着也可以注册,后面我又加了个判断语句,不知道是代码错了还是怎么的 ,一直用不上,朋友帮帮我,下面是代码
<title>无标题文档</title>
<script>
function BeforeSubmit()
{
if(document.form1.username.value=="")
{
alert("请填写你的用户名!"):
form1.username.focus():
return false:
}
return true:
}
</script>
</head>

<body>会员注册
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form ACTION="<%=MM_editAction%>" METHOD="POST" id="form1" name="form1" onsubmit="return BeforeSubmit()">

看看是吧是哪儿出错了,我写的如果用户名空着就提示

是分号“;”不是冒号“:” 注意了
<script>
function BeforeSubmit()
{
if(document.form1.username.value=="")
{
alert("请填写你的用户名!");
form1.username.focus();
return false;
}
return true;
}
</script>

你能不能把这个页面的代码都发出来?不要发一点么