注册 登录
编程论坛 ASP技术论坛

[求助]麻烦看一下有什么错误?怎么实现递交?

mnll 发布于 2007-10-20 16:43, 495 次点击
<html>
<style type="text/css">
<!--
.STYLE2 {font-size: 12px; }
-->
</style>
<body>
<table width="800" height="200" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="200" valign="top"><form name="form1" method="post" action="">
<label></label>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>用户名:&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="text" name="Username">
</label></td>
</tr>
<tr>
<td>密码:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<input type="text" name="UserPwd"></td>
</tr>
<tr>
<td>电子邮箱 :&nbsp;
<input type="text" name="Email"></td>
</tr>
</table>
</form>
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form name="form2" method="post" action="">
<div align="center">
<input type="submit" name="Submit" value="提交">&nbsp;&nbsp;
<input type="submit" name="Submit2" value="重置">
</div>
</form>
</td>
</tr>
</table>
<p align="center">                   </p>
</td>
</tr>
</table>
<%
UserName=Trim(Request.Form("Username"))
UserPwd=Request.Form("UserPwd")
Email=Request.Form("Email")
If Username="" or UserPwd=""or Email="" then
Response.Write"<script>alert('填写不完全!');history.back();</script>"
Response.End
ElseIf Not CheckLetter(Username) Then
Response.Write"<script>alert('输入的用户名没有全部是大写或小写字母!');history.back();</script>"
Response.End
ElseIf Not Numertic(UserPwd) Then
Response.Write"<script>alert('输入的密码不能为非数字!')</script>;history.back();</script>"
Response.End
ElseIf Not ISValidEmail(Email) Then
Response.Write"<script>alert('输入的邮件地址格式不正确!');history.back();</script>"
Response.End
Else
Response.Write"<center>输入正确!"
End If
%>
就是后面的asp代码没有实现验证表单的功能!

5 回复
#2
tianyu1232007-10-20 16:47

<%
UserName=Trim(Request.Form("Username"))
UserPwd=Request.Form("UserPwd")
Email=Request.Form("Email")
If Username="" or UserPwd=""or Email="" then
Response.Write"<script>alert('填写不完全!');history.back();</script>"
Response.End
ElseIf Not CheckLetter(Username) Then
Response.Write"<script>alert('输入的用户名没有全部是大写或小写字母!');history.back();</script>"
Response.End
ElseIf Not Numertic(UserPwd) Then
Response.Write"<script>alert('输入的密码不能为非数字!')</script>;history.back();</script>"
Response.End
ElseIf Not ISValidEmail(Email) Then
Response.Write"<script>alert('输入的邮件地址格式不正确!');history.back();</script>"
Response.End
Else
Response.Write"<center>输入正确!"
End If
%>

红色部位的函数都定义了吗?

从你的代码中没发现定义这些函数啊,也没有包含其他文件啊!
#3
yms1232007-10-20 16:56
<form name="form2" method="post" action="">
<div align="center">
<input type="submit" name="Submit" value="提交">&nbsp;&nbsp;
<input type="submit" name="Submit2" value="重置">
</div>
</form>
这里的问题,提交按钮实际上是另一个表单里的。
#4
yms1232007-10-20 17:31
楼主的代码提交到了?
#5
mnll2007-10-21 09:37
回复:(yms123)
<html>
<style type="text/css">
<!--
.STYLE2 {font-size: 12px; }
-->
</style>
<body>
<table width="800" height="200" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="800" height="200" valign="top"><form name="form1" method="post" action="">
<label></label>
<table width="800" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>用户名:&nbsp;&nbsp;&nbsp;&nbsp;
<label>
<input type="text" name="Username">
</label></td>
</tr>
<tr>
<td>密码:&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;
<input type="password" name="UserPwd"></td>
</tr>
<tr>
<td height="18">电子邮箱 :&nbsp;
<input type="text" name="Email"></td>
</tr>
<tr>
<td height="19"><div align="center">
<input type="submit" name="Submit" value="提交">
 
<input type="submit" name="Submit2" value="重置">
</div></td>
</tr>
</table>
</form>
<p align="center">  </p>
</td>
</tr>
<%
Dim IsValidEmail,CheckLetter,Numertic
UserName=Trim(Request.Form("Username"))
UserPwd=Request.Form("UserPwd")
Email=Request.Form("Email")
If Username="" or UserPwd=""or Email="" then
Response.Write"<script>alert('填写不完全!');history.back();</script>"
Response.End
ElseIf Not CheckLetter(Username) Then
Response.Write"<script>alert('输入的用户名没有全部是大写或小写字母!');history.back();</script>"
Response.End
ElseIf Not Numertic(UserPwd) Then
Response.Write"<script>alert('输入的密码不能为非数字!')</script>;history.back();</script>"
Response.End
ElseIf Not ISValidEmail(Email) Then
Response.Write"<script>alert('输入的邮件地址格式不正确!');history.back();</script>"
Response.End
Else
Response.Write"<center>输入正确!"
End If
%>
</table>
</body>
</html>
但是不管怎么提交都显示填写不完全阿!????


1