接收不到表单数据,,,帮忙看下,,

sbyniwwg 2009-04-18 01:25:22
做一个文章更改页面...从前面一个页面接收到一个ID查询完数据放在表单里,在编辑完后提交到本页面,接收不到.

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>更改试题</title>
<link rel="stylesheet" rev="stylesheet" href="css/style.css" type="text/css" media="all" />



<style type="text/css">
<!--
.atten {font-size:12px;font-weight:normal;color:#F00;}
.STYLE1 {color: #FF0000}
-->
</style>
<%

if(request.Form("hidden")="") then
dim id
id=request.QueryString("Id")
response.Write(id)
set rs=server.CreateObject("adodb.recordset")
sql="select * from questions where Id="+request.QueryString("Id")+""
rs.open sql,conn,1,1

else

set rs=server.CreateObject("adodb.recordset")
sql="select * from questions where Id="+request.QueryString("hidden_id")+""
rs.open sql,conn,1,3
rs("Questions")=request.Form("questions")
rs("Answer")=request.Form("answer")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
end if

%>
</head>

<body class="ContentBody">
<form action="change_questions.asp?id=<%=request.QueryString("Id")%>" method="post" name="form_chanage" >
<div class="MainDiv">
<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
<tr>
<th class="tablestyle_title" >水平测试信息管理</th>
</tr>
<tr>
<td class="CPanel">

<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
<tr><td align="left">
<input type="button" name="Submit" value="保存" class="button" onclick="alert('保存成功!');"/> 

<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/>
</td></tr>
<tr align="center">
<td class="TablePanel">添加水平测试题目</td>
</tr>

<TR>
<TD width="100%">
<fieldset style="height:100%;">
<legend>项目功能信息</legend>
<table border="0" cellpadding="2" cellspacing="1" style="width:100%">

<tr>
<td nowrap align="right" width="15%">试题题目:</td>
<td colspan="3"><input name="questions" type="text" class="text" style="width:300px" value="<%=rs("Questions")%>" />
<span class="red">*</span></td>
</tr>

<tr>
<td align="right">试题类型:</td>
<td width="34%"><label>
<input type="radio" name="radio" id="questions_type" value="questions_type" />选择题     <input type="radio" name="radio" id="questions_type" value="questions_type" />问答题
</label></td>
<td width="15%" align="right"> </td>
<td width="36%"> </td>
</tr>
<tr>
<td align="right">试题答案:
<br />
参考答案(<span class="STYLE1">仅供参考</span>)</td>
<td colspan="3"><textarea name="answer" cols="100" rows="10"><%=rs("Answer")%></textarea></td>
</tr>
</table>
<%set rs=nothing%>
<br />
</fieldset> </TD>
</TR>
</TABLE>


</td>
</tr>




<TR>
<TD colspan="2" align="center" height="50px">
<input type="hidden" name="hidden_id" value=<%=request.QueryString("Id")%> />
<input type="submit" name="save" value="保存" class="button"/> 

<input type="button" name="Submit2" value="返回" class="button" onclick="window.history.go(-1);"/></TD>
</TR>
</TABLE>


</td>
</tr>



</table>

</div>
</form>
</body>
</html>
...全文
56 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
gmlwl 2009-04-19
  • 打赏
  • 举报
回复
没有hidden这个表单,换一个有的就可以.
lh57 2009-04-18
  • 打赏
  • 举报
回复
if(request.Form("hidden")="") then

这句写错了吧?没有这个变量,好象应该改为

if(request.Form("hidden_id")="") then
sbyniwwg 2009-04-18
  • 打赏
  • 举报
回复
会的朋友指点下..

我是一个页面放了几个窗口,,main窗口的页面提交的页面也在main窗口,,可是为什么,,表单数据接收不到

28,390

社区成员

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

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