ASP表单验证问题
哪位大大帮忙看一下我这页代码是哪里出错了啊~~~~总是弹出页面"请输入用户名!"<%@language=VBScript%><!--#includefile="setup...
哪位大大帮忙看一下我这页代码是哪里出错了啊~~~~总是弹出页面"请输入用户名! "
<%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%
sql="select * from username"
set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,1,1
%>
<style type="text/css">
<!--
.STYLE2 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
<script language="javascript">
<!--
function verify(){
if (document.form.RadioGroup1.value==""){
alert("请选择要添加记录的冷冻机编号!");
return false;
}
if (document.form.selectname.value=="") {
alert("请输入用户名!");
form.selectname.focus();
return false;
}
return true;
}
-->
</script>
<tr>
<div align="left" class="STYLE2"> 添加冷冻机运行记录</div>
</tr>
<table border="1">
<form name="form" method="POST" onsubmit="return verify();" action="add.asp" >
<tr>
<td width="256" rowspan="5" nowrap="nowrap"><div align="center">请选择当前运行中的冷冻机编号:</div></td>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="1" />1#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="2" />2#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="3" />3-1#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="4" />3-2#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="0" />未运行</label>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><div align="center">请选择记录人姓名:</div></td>
<td><label>
<select name="selectname" style="width:115px">
<option selected="selected"></option>
<%
dim i
do while not Rs.eof
%>
<option><%=Rs("uname")%></option>
<%
Rs.movenext
loop
%>
</select>
</label></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input type="submit" name="Submit1" value="确 定" onClick="return checkk();">
<input type="reset" name="Submit2" value="重 置" />
<input type="button" name="Submit3" value="返 回" onClick="javascript:history.back(-1);">
</div></td>
</tr>
</form>
</table> 展开
<%@ language=VBScript %>
<!--#include file="setup.asp"-->
<%
sql="select * from username"
set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,1,1
%>
<style type="text/css">
<!--
.STYLE2 {
font-size: 18px;
font-weight: bold;
}
-->
</style>
<script language="javascript">
<!--
function verify(){
if (document.form.RadioGroup1.value==""){
alert("请选择要添加记录的冷冻机编号!");
return false;
}
if (document.form.selectname.value=="") {
alert("请输入用户名!");
form.selectname.focus();
return false;
}
return true;
}
-->
</script>
<tr>
<div align="left" class="STYLE2"> 添加冷冻机运行记录</div>
</tr>
<table border="1">
<form name="form" method="POST" onsubmit="return verify();" action="add.asp" >
<tr>
<td width="256" rowspan="5" nowrap="nowrap"><div align="center">请选择当前运行中的冷冻机编号:</div></td>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="1" />1#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="2" />2#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="3" />3-1#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="4" />3-2#冷冻机</label>
</td>
</tr>
<tr>
<td width="114">
<label><input type="radio" name="RadioGroup1" value="0" />未运行</label>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td><div align="center">请选择记录人姓名:</div></td>
<td><label>
<select name="selectname" style="width:115px">
<option selected="selected"></option>
<%
dim i
do while not Rs.eof
%>
<option><%=Rs("uname")%></option>
<%
Rs.movenext
loop
%>
</select>
</label></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input type="submit" name="Submit1" value="确 定" onClick="return checkk();">
<input type="reset" name="Submit2" value="重 置" />
<input type="button" name="Submit3" value="返 回" onClick="javascript:history.back(-1);">
</div></td>
</tr>
</form>
</table> 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询