急!请高手帮助解决,为什么在sub中得不表单上的控件值?
因为在选择框中设定了submit,所以用sub定义保存过程,请高手帮助解决,为什么在sub中得不表单上的控件值?源代码如下:<%@ LANGUAGE="VBScript" %>
<html>
<head>
</head>
<body>
<script LANGUAGE="VBSCRIPT" >
<!--
Sub myadd_OnClick
dim msg,mylrqx,mylrfw,mylrsm
mylrqx=request.form("menuqx")//获取用户选择框值,但录入库中却为空值???
mylrfw=request.form("menufw")//获取项目选择框值,但录入库中却为空值???
mylrsm=request.form("lrmenusm")//获取文本框值,但录入库中却为空值???
<%
mysysda="[01_mainmenu]"
Set sqlconn = Server.CreateObject("ADODB.Connection")
connstr="Driver={SQL Server};Server=......."//连接语句
sqlconn.open connstr
mmymenuadd = trim(Request("myadd"))
set rst=server.createobject("adodb.recordset")
sqlrst="select max(leftid) as newleftid from [01_mainmenu]"
rst.open sqlrst,sqlconn,1,1
if rst.recordcount>0 then
mybhcount=cstr(cint(trim(rst("newleftid")))+1)
if len(trim(mybhcount))<=1 then
mybhcount="0"&trim(mybhcount)
else
mybhcount=mybhcount
end if
end if
rst.close
set rst=nothing
set rsmenu=server.createobject("adodb.recordset")
sqlmenu="select * from "&trim(mysysda)&" where menuqx='"&trim(mylrqx)&"' and menufw='"&trim(mylrfw)&"'"
rsmenu.open sqlmenu,sqlconn,1,3
if rsmenu.recordcount>0 then
set rs=server.createobject("adodb.recordset")
sql="select * from "&trim(mysysda)&" where menusm='"&trim(mylrsm)&"' and menuqx='"&trim(mylrqx)&"' and menufw='"&trim(mylrfw)&"'"
rs.open sql,sqlconn,1,3
if rs.recordcount>0 then
else
rs.addnew
rs("leftid")=trim(mybhcount)
rs("menusm")=trim(mylrsm)
rs("menuclj")="gly\left_menu.asp"
rs("menuqx")=trim(mylrqx)
rs("menufw")=trim(mylrfw)
rs.update
rs.close
set rs=nothing
end if
else
if len(trim(lrmenubh))<=1 then
mylrmenubh="0"&trim(lrmenubh)
else
mylrmenubh=trim(mylrmenubh)
end if
rsmenu.addnew
rsmenu("leftid")=trim(mylrmenubh)
rsmenu("menusm")=trim(mylrsm)
rsmenu("menuclj")="menu.asp"
rsmenu("menuqx")=trim(mylrqx)
rsmenu("menufw")=trim(mylrfw)
rsmenu.update
end if
rsmenu.close
set rsmenu=nothing
%>
End Sub
-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<form name="fqs" action="sys_add_menutop.asp" method="post" target="result">
<center>
<div align="center"><b><font color="#FF0000">增加功能</font></b></font>
</marquee>
</div>
<div align="center">
<table width="439" height="157" border="1">
<td width="99"><div align="center">用户</div></td>
<td width="171"><select name="menuqx" style="width:152px;" onChange= "fqs.submit()">
<option value="">--请选择--</option>
<option value="操作用户">操作用户</option>
<option value="查询用户">查询用户</option>
</select> </td>
<td><div align="left"><font color="#FF0000">* 请选择</font></div></td>
</tr>
<tr>
<td width="99"><div align="center">项目</div></td>
<td width="171"><select name="menufw" style="width:152px;" onChange= "fqs.submit()">
<option value="">--请选择--</option>
<option value="任务进度">任务进度</option>
<option value="综合信息">综合信息</option>
</select></td>
<td><div align="left"><font color="#FF0000">* 请选择</font></div></td>
</tr>
<tr>
<td width="99"><div align="center">功能</div></td>
<td><input type="text" name="lrmenusm"></td>
<td><div align="left"><font color="#FF0000">* 请录入</font></div></td>
</tr>
<tr>
</table>
</div>
</form>
</center>
<div align="center">
<input type="button" name="myadd" value="保存">
</div>
</body>
</html>