表单的问题,急着要解决,在线等待~

whggg 2003-10-16 11:07:03
我在做表单提交,提交后,检查所填信息是否有错。有错返回表单提交页,先前所填的内容不能丢失。
我现在的问题是,我填写以下表单时,所填内容就会丢失。填写其他表单没有问题。
怎样解决这问题~

<SCRIPT language=javascript>
function PopupCatSel(ID)
{
var selProdWnd=window.open("select_sort"+ID+".asp","new","resizable=yes,width=490,height=280,top=0,scrollbars=yes");
if(selProdWnd.opener== null)
selProdWnd.opener = self;
return (false);
}
</SCRIPT>

<INPUT disabled name=ClassName size=25 >
<INPUT name=cat onclick=return(PopupCatSel(1)) type=button value=请选分类>
<font color=#ff0000 size=3>
<input type="button" name="Submit1" value="清空" onclick="qingkong()">*</font>
<INPUT name=BigClassID type=hidden >
<INPUT name=SmallClassID type=hidden >
...全文
41 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
whggg 2003-10-16
  • 打赏
  • 举报
回复
表单提交后,处理上应该是没有问题的。
hidden的value这个值是可以取到的,没有问题。
程序上我个人认为是没有问题的。
现在的问题是,数据不符合要求,返回表单后,表单里的值会被清空
这点该这样解决。
还在急求答案,分不够,再加。
avonqin 2003-10-16
  • 打赏
  • 举报
回复
选择分类表单没问题!
你提交表单后的处理有问题
对了,你把类别的值付给hidden的value里呀?这样可以?呵呵~~~没这样用过
whggg 2003-10-16
  • 打赏
  • 举报
回复
myfc(狂草)
用"javascript:history.go(-1)"就好了啊
我试过,不行
是选择分类表单的问题。


myfc 2003-10-16
  • 打赏
  • 举报
回复
用"javascript:history.go(-1)"就好了啊
avonqin 2003-10-16
  • 打赏
  • 举报
回复
你的提交表单代码、javascript判断代码?
whggg 2003-10-16
  • 打赏
  • 举报
回复
继续求答案。
谢谢大家的支持~
whggg 2003-10-16
  • 打赏
  • 举报
回复
Select_Type.asp文件名,选择小类

<%Option Explicit%>
<!--#include file="../../INC/Conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>选择行业类别</title>
<LINK href="../Style.css" rel=stylesheet type=text/css>
</head>
<SCRIPT LANGUAGE="JavaScript">
function retForm(BigClassID,SmallClassID,BigClassName,SmallClassName)
{
if (!opener) return true;
opener.document.form.BigClassID.value = BigClassID;
if (!opener) return true;
opener.document.form.SmallClassID.value = SmallClassID;
if(opener.document.form.ClassName)
opener.document.form.ClassName.value = BigClassName+ " >> "+ SmallClassName;
self.close();
return false;
}
</SCRIPT>
<%
dim BigClassID,SmallClassID,BigClassName,SmallClassName,Rs,Sql,Rs1,Sql1
if not isEmpty(request("BigClassID")) then
BigClassID=request("BigClassID")
else
BigClassID=1
end if
Set Rs= Server.CreateObject("ADODB.Recordset")
Sql="select * from corporation_bigclass where ID="&BigClassID&""
Rs.open Sql,conn,1,1
BigClassName=Rs("BigClassName")
Rs.close
set Rs1=server.createobject("adodb.recordset")
Sql1="select * from corporation_smallclass where BigClassID="&BigClassID&""
Rs1.open Sql1,conn,1,1
%>
<CENTER>
<TABLE border=0 cellPadding=3 cellSpacing=0 width="440">
<TBODY>
<tr>
<td colspan=6><img src="images/hangye.gif" width="440" height="28" border="0"></td>
</tr>
<tr><td colspan=6 height=10><div align="right"><a href="select_sort.asp">返回上一级
>></a></div></td></tr>
<TR>
<TD align=middle vAlign=top width=600>
<TABLE border="0" width="100%" cellpadding="0">
<%do while not Rs1.eof%>
<TR>
<td width="5%" height="20" align="center"></td>
<td width="28%" height="20" align="left">
<%If Not Rs1.Eof then%>
<p style="line-height: 150%"><IMG src="images/list.gif" width="10" height="12">
<a href="" onclick="return retForm('<%=BigClassID%>','<%=Rs1("ID")%>','<%=BigClassName%>','<%=Rs1("SmallClassName")%>')"><%=Rs1("SmallClassName")%></a><font size="1" color="#ff6600"></font></TD>
<%Rs1.movenext
End If
%>
<td width="5%" height="20" align="center"></td>
<td width="28%" height="20" align="left">
<%If Not Rs1.Eof then%>
<p style="line-height: 150%"><IMG src="images/list.gif" width="10" height="12">
<a href="" onclick="return retForm('<%=BigClassID%>','<%=Rs1("ID")%>','<%=BigClassName%>','<%=Rs1("SmallClassName")%>')"><%=Rs1("SmallClassName")%></a><font size="1" color="#ff6600"></font></TD>
<% Rs1.movenext
End If
%>
<td width="5%" height="20" align="center"></td>
<td width="29%" height="20" align="left" >
<%If Not Rs1.Eof then%>
<p style="line-height: 150%"><IMG src="images/list.gif" width="10" height="12">
<a href="" onclick="return retForm('<%=BigClassID%>','<%=Rs1("ID")%>','<%=BigClassName%>','<%=Rs1("SmallClassName")%>')"><%=Rs1("SmallClassName")%></a><font size="1" color="#ff6600"></font></TD>
</TR>
<% Rs1.movenext
End If
loop
Rs1.close
%>


</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
whggg 2003-10-16
  • 打赏
  • 举报
回复
Select_Sort1.asp文件名,选择大类

<%Option Explicit%>
<!--#include file="../../INC/Conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>选择行业类别</title>
<LINK href="../Style.css" rel=stylesheet type=text/css>
</head>
<%Dim Rs,Sql
Set Rs= Server.CreateObject("ADODB.Recordset")
Sql="select * from corporation_bigclass"
Rs.open Sql,conn,1,1
%>
<center>
<TABLE border="0" width="440" cellpadding="0" height="47">
<tr>
<td colspan=6><img src="images/hangye.gif" width="440" height="28" border="0"></td>
</tr>
<tr>
<td colspan=6 height=20></td>
</tr>
<%do while not Rs.eof%>
<tr height=25>
<td width="33%" align="left">
<%If Not Rs.Eof then%>
<IMG src="images/dir.gif" width="14" height="14">
<a href="select_type.asp?BigClassID=<%=Rs("ID")%>"><%=Rs("BigClassName")%></a>
<%Rs.movenext
End if%>
</td>
<td width="33%" align="left">
<%If Not Rs.Eof then%>
<IMG src="images/dir.gif" width="14" height="14">
<a href="select_type.asp?BigClassID=<%=Rs("ID")%>"><%=Rs("BigClassName")%></a>
<%Rs.movenext
End if%>
</td>
<td width="33%" align="left">
<%If Not Rs.Eof then%>
<IMG src="images/dir.gif" width="14" height="14">
<a href="select_type.asp?BigClassID=<%=Rs("ID")%>"><%=Rs("BigClassName")%></a>
<%Rs.movenext
End if%>
</td>
</tr>
<%
loop
Rs.close
set Rs=nothing
%>
</TABLE>
</body>
</html>
avonqin 2003-10-16
  • 打赏
  • 举报
回复
select_sort1.asp选择分类后返回opener页面的代码你是怎么写的呢?
whggg 2003-10-16
  • 打赏
  • 举报
回复
不是这个问题。和返回键没有关系
<INPUT name=cat onclick=return(PopupCatSel(1)) type=button value=请选分类>
这个表单内容,我不填写,值为空,返回是有保留值的。
填写这表单后,返回,所有表单里的值,全部丢失。

angelheavens 2003-10-16
  • 打赏
  • 举报
回复
不管是否有错均获取填写信息:
a)如果为真,一起提交;
b)如果为假,插入保留信息;


(如果有疑问,请发短信息来相互讨论)
pp4u 2003-10-16
  • 打赏
  • 举报
回复
返回按纽用:
<input type="button" name="Submit1" value="返回" onclick="javascript:history.go(-1)">">
whggg 2003-10-16
  • 打赏
  • 举报
回复
值完全可以取到的,我判断是在提交表单后asp程序进行判断,不符合条件,报错信息,返回表单。
直到数据完全正确。
1.asp ->提交表单页面
2.asp ->程序判断数据是否正确 (Yes->写入数据库,No->返回表单页面)
注:返回表单页,要求数据不能丢失。
我现在的现象,<INPUT name=cat onclick=return(PopupCatSel(1)) type=button value=请选分类>只要填写这个表单的值,判断数据不合格时,返回表单,数据全部丢失
如果不填写这个表单,判断数据不合格时,返回表单,数据没有丢失


avonqin 2003-10-16
  • 打赏
  • 举报
回复
要不你用一组正确的数据作试验,看能否在接收页面获得数据?
avonqin 2003-10-16
  • 打赏
  • 举报
回复
你是提交表单时,数据不符合要求(你是用javascript判断呢还是在接收页面判断?),如果是用javascript判断,那你的javascript程序有问题吧?

28,390

社区成员

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

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