| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 597 人关注过本帖
标题:谁来帮我一下!!!!!
只看楼主 加入收藏
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
 问题点数:0 回复次数:9 
谁来帮我一下!!!!!

一个页面中,两个表单,第一个表单提交到本页,然后根本第一个表单提交处理的结果,选中单选按钮,显示隐藏的div,第二个表单在div中,处理第二个表单,处理完后也提交到本页,可是现在的情况是第二个表单提交完了后就返回到最原始的第一个表单没有提交时的状态,并且第二个表单本来要对数据库作的操作,也没有作反应。哪位好心人知道,帮忙啊,急@!!!

[此贴子已经被作者于2007-4-12 9:53:05编辑过]

搜索更多相关主题的帖子: 数据库 决赛 
2007-04-11 17:40
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
得分:0 

顶一下


2007-04-12 09:44
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
代码贴来看看。
2007-04-12 09:53
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
得分:0 

exchange.asp

<%@ codepage ="936" %>
<!--#include file="../dbconn1.asp" -->
<!--#include file="date.asp" -->
<!--#include file="monthday.asp" -->

<%
if opname=session("opname") then
response.redirect "adminerror.asp"
else
opname=session("opname")
end if
%>

<HTML><HEAD>

<link rel="stylesheet" type="text/css" href="style.css">
<meta http-equiv="Content-Language" content="zh-cn">
<TITLE>E时代网络广场欢迎您!</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK
href="css/style.css" type=text/css rel=stylesheet>
<SCRIPT language=JavaScript>
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>

<META content="Microsoft FrontPage 5.0" name=GENERATOR>
<style type="text/css">
<!--
a:link {
color: #0099FF;
text-decoration: underline;
}
a:visited {
text-decoration: underline;
color: #00CC99;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: underline;
color: #990033;
}
.style5 {font-size: 16px; font-weight: bold; }
-->
</style>
</HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=0
background=images/index_bg.jpg topMargin=0 marginheight="0" marginwidth="0">
<DIV align=center>
<TABLE cellSpacing=0 cellPadding=0 width=842 border=0>
<TBODY>
<TR>
<TD width=900><object
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0
height=200 width=842 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>
<param name="movie" value="images/navy.swf" />
<param name="quality" value="High" />
<param name="flashvars" value="" />
<param name="_cx" value="22278" />
<param name="_cy" value="5292" />
<param name="Src" value="images/navy.swf" />
<param name="WMode" value="Window" />
<param name="Play" value="-1" />
<param name="Loop" value="-1" />
<param name="SAlign" value />
<param name="Menu" value="-1" />
<param name="Base" value />
<param name="AllowScriptAccess" value="always" />
<param name="Scale" value="ShowAll" />
<param name="DeviceFont" value="0" />
<param name="EmbedMovie" value="0" />
<param name="BGColor" value />
<param name="SWRemote" value />
<param name="MovieData" value />
<param name="SeamlessTabbing" value="1" />
<embed src="../main_swf/navy.swf"
flashvars="wh=4" quality=high
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="842" height="200"> </embed>
</object></TD>
</TR>
<TR>
<TD align=middle bgColor=#ffffff>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 style="border-collapse: collapse" bordercolor="#111111">
<TBODY>
<TR>
<form name="form1" method="post" action="exchange.asp">
<table width="561" border="0" align="center">
<tr>
<td width="186">上网卡号:
<input name="cardid" type="text" id="cardid" size=16>
<input name="flag" type="hidden" id="cardid" value="1">
</td>
<td width="154"><input name="I1" type=image src="../image/search1.gif" align=absMiddle border=0 width="43" height="18"></td>
<td width="116"></td>
<td width="87"></td>
</tr>
</table>
</form>
<%
flag=request.form("flag")
if flag=1 then
mess="对不起没有您要查询的记录"
else
mess=""
end if
scardid=request.form("cardid")
set rs=server.CreateObject("adodb.recordset")
'sql="SELECT scardid,sname,scardtype,sIDcard from tusers join tlogs where sCardID='"&scardid&"'
sql="SELECT distinct tusers.scardid ,tusers.sname ,tlogs.scardtype,tlogs.sIDcard from tusers join tlogs on tusers.scardid=tlogs.scardid where tusers.sCardID='"&scardid&"'"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
%>
<TABLE border="0" cellspacing="0" width="488" cellpadding="0">
<TR>
<TD align=center height=25 width="591"></TD></tr>
<tr><td><div align="center"><%=mess%></div></td></tr>
</TABLE>
</TR>
</TBODY>
</TABLE></TD></TR>
</TBODY></TABLE>
<TR>
<TD bgColor=#ffffff>
<IMG height=89 src="../index/images/down_only.GIF"
width=842></TD></TR></TBODY></TABLE>

</DIV></BODY></HTML>
<%
else
scardid=rs("scardid")
sname=rs("sname")
scardtype=rs("scardtype")
sIDcard=rs("sIDcard")
session("scardid")=rs("scardid")
'sum3为总积分,sum1为已扣积分,sum2为剩余积分
dim sum1,sum2,sum3
set rssum=server.createobject("adodb.recordset")
sql="select sum(creceived) as sum3 from tlogs where scardid='"&scardid&"' and dttime1>='"&date1&"' and dttime1<'"&date2&"'"
rssum.open sql,conn,1,1
sum3=rssum("sum3")
if isnull(sum3) then '判断sum3是否为空(null)
sum3=0
end if
rssum.close
set rssum=nothing
'计算已扣积分
' set rsdel=server.CreateObject("adodb.recordset")
' sql="SELECT sum(del_score) as sum1 from del_score_log where CardID='"&scardid&"'"
' rsdel.open sql,conn,1,1
' sum1=rsdel("sum1")
' if isnull(sum1) then '判断sum1是否为空(null)
' sum1=0
' end if
' rsdel.close
' set rsdel=nothing
' '计算剩余积分
' sum2=sum3-sum1

%>

<TABLE border="1" cellspacing="0" width="560" cellpadding="4" bordercolorlight="#CAE6FF" bordercolordark="#CAE6FF" style="border-collapse: collapse" bordercolor="#111111">
<tr align="center">
<td width="90">卡号</td>
<td width="90">姓名</td>
<td width="90">证件名称</td>
<td width="120">证件号</td>
<td width="120">可兑积分</td>
</tr>
<tr align=center>
<td><%=scardid%></td>
<td><%=sname%></td>
<td><%=scardtype%></td>
<td><%=sIDcard%></td>
<td><%=sum3%></td>

</tr>
</table>
<table border="0" cellspacing="0" width="560" height="30"cellpadding="0"><tr><td width="100%" align="center" valign="middle"><strong><input name="exchange" type="checkbox" value="exchange" onClick="return confirm('你确定要兑换积分吗?')" />兑换积分</strong></td></tr></table>
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" align="center" >
<tr><td width="560"><form action="exchange.asp" method="post" name="form2" onSubmit="return Binder(this);">
<table cellpadding="0" cellspacing="0" border="0" align="center" >
<tr><td width="550" height="50" colspan="2" align="center" bgcolor="#E7E7E7"><strong>请选择您要兑换的积分,可获得不同面额的优惠券</strong></td>
</tr>
<tr>
<td height="30" width="275" align="center">兑换积分:<select name="score" id="score" onChange="javascript:ChangeScore(this.value,this)">
<optgroup label="积分种类">
<option value="0">800</option>
<option value="1">500</option>
<option value="2">300</option>
<option value="3">200</option>
</optgroup>
</select>分</td>
<td width="275" align="center">兑奖金额(¥):
<select name="money" id="money" onChange="javascript:ChangeMoney(this.value,this)">
<optgroup label="券面值">
<option value="0">200</option>
<option value="1">100</option>
<option value="2">50</option>
<option value="3">20</option>
</optgroup>
</select>元
</td> </tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="550" ><tr>
<td height="36" colspan="3" align="left" valign="bottom" bgcolor="#E7E7E7" ><strong> 所兑奖券的编号清单:</strong></td>
</tr>
<tr><td colspan="2" align="left"><select name="codeList" size="20" multiple class="liststy" onDblClick ="javascript:Listchange()" ></select></td>
<td width="196" valign="top"> <p><strong>       注 明:</strong></p>
<p>  输入单行文本框中的内容,按"</p>
<p>确认"后,保存在列表框中,列表框</p>
<p>中可同时保存多列数据,当一次操作</p>
<p>完后,再按"提交数据库"进行写入</p>
<p>数据库.</p>
<p>
<!-- <input type="image" id="submit" width="80" height="32" img src="images/submit.gif"> //-->
<input type="submit" name="submit" value="提交到数据库">
</p></td>
</tr>
<tr>
<td width="69" height="40" align="left" valign="middle"><label><strong>奖券编号:</strong></label></td>
<td width="215" align="left" valign="middle"><input name="code" type="text" size="30" class="inputsty"></td>
<td height="40" align="left" valign="middle" id="tt">&nbsp;</td>
</tr>
</table></form><table width="500" height="22" border="0" align="center" cellpadding="0" cellspacing="0"><tr><td width="113" ></td>
<td width="122" align="left" valign="top"><input type="image" name="btsure2" src="images/addbt.gif" width="60" height="22" onClick="javascript:inputList()">
</td>
<td width="265"></td>
</tr></table></td></tr></table>

<%
submit = Request.Form("submit")
if(submit="提交到数据库") then
codelist = Request.Form("codelist")
arrayCL = split(codelist,",")
for i=LBound(arrayCL) to UBound(arrayCL)
arrayCL=trim(arrayCL(i))
dim recordsum,flag,updatetime
recordsum=0
scardid=session("scardids")
updatetime=now()
set rscode=server.CreateObject("adodb.recordset")
sqlcode="select * from ticket where T_flag=0 and T_ticketID='"&trim(arrayCL(i))&"'"
rscode.open sqlcode,conn,1,1
if rscode.eof and rscode.bof then
Response.Write(arrayCL(i)&"这个编号有误!请重新输入")
flag=0
else
set rsupdate=server.CreateObject("adodb.recordset")
sqlupdate="update ticket set T_scardid='"&scardid&"',T_operator='"&opname&"',T_datetime='"&updatetime&"',T_flag=1 where T_ticketID='"&arrayCL(i)&"'"
response.Write(sqlupdate)
rsupdate.open sqlupdate,conn,1,3
rsupdate.close
set rsupdate=nothing
Response.Write("成功")
flag=1
recordsum=recordsum+1
end if
next
end if
%>

<%
rs.close
set rs=nothing
%>

</center></TD></TR>
<TR>
<TD bgcolor="#FFFFFF">
</TD></TR>

<TR>
<TD bgColor=#ffffff>
<IMG height=89 src="../index/images/down_only.GIF"
width=842></TD></TR></TBODY></TABLE>

</DIV></BODY></HTML>

<%end if%>
<script language="javascript">
<!--
function ChangeScore(cindex,obj)
{
document.all.money.options[cindex].selected = true;
}

function ChangeMoney(cindex,obj)
{
document.all.score.options[cindex].selected = true;
}

function inputList()
{
var val =document.all.code.value;
var regexp = new RegExp("[0-9]{7,}")
if(!regexp.test(val))
{
alert('对不起!请输入数字,确保你输入了正确的奖券编号!');
document.all.code.focus();
return false;
}
else
{
document.all.codeList.add(new Option(val,val));
document.all.code.value="";
}
}
function Listchange()
{
var obj = document.all.codeList;
try
{
obj.options.remove(obj.options[obj.selectedIndex].index);
}
catch(exp){}

}
//-->
</script>
<script language="javascript" event="onkeydown" for="document">
<!--
if(event.keyCode==13)
{
return false;
}
//-->
</script>
<script language="javascript">

function Binder(form)
{
var sel = form.codeList;
var intSelCL = sel.options.length;
for(i=0;i<intSelCL;i++)
{
sel.options[i].selected = true;
}
}
</script>


2007-04-12 10:01
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
得分:0 

nofresh.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../dbconn1.asp" -->
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK
href="css/style.css" type=text/css rel=stylesheet>
</head>
<body>

<SCRIPT language=JavaScript>
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>
<script language="javascript">
<!--
function checkText(form)
{
var val=form.code.value;
var regexp = new RegExp("[0-9]{7,}")
if(!regexp.test(val))
{
alert('对不起!请输入数字,确保你输入了正确的奖券编号!');
form.code.focus();
return false;
}
else
return false;
}
function inputList(val)
{


window.parent.document.all.form2.codeList.add(new Option(val,val));
document.all.form1.code.value="";
return false;

}
//-->
</script>
<script language="javascript" event="onkeydown" for="document">
<!--
if(event.keyCode==13)
{
return false;
}
//-->
</script>


<table border="0" align="center" cellpadding="0" cellspacing="0">
<form method="post" id="form1" name="form1" onSubmit="checkText(this)" >
<tr>
<td width="69" height="40" align="left" valign="middle"><strong>奖券编号:</strong></td>
<td width="297" align="center" bgcolor="#FFFFFF"><input name="code" type="text" id="code" class="inputsty"/></td>
<td width="100" align="center" bgcolor="#FFFFFF"><input type="submit" name="submit" value="增加" /></td>
</tr>
</form>
</table>
</body>
</html>
<%
'scardid=session("scardid")
set rscode=server.CreateObject("adodb.recordset")
ticketID=trim(request.Form("code"))

submit=Request.Form("submit")
if submit="增加" then
sqlcode="select * from ticket where T_flag=0 and T_ticketID='"&ticketID&"'"
rscode.open sqlcode,conn,1,1

if rscode.eof and rscode.bof then
response.write("<script>alert('没有找到,请检查以确保输入无误');</script>")
else

Response.Write("<script>inputList('"& ticketID &"');</script>")
response.Write("找到")
end if

end if
rscode.close
set rscode=nothing
%>


2007-04-12 10:02
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
得分:0 

nofresh.asp

<!--#include file="../dbconn1.asp" -->
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK
href="css/style.css" type=text/css rel=stylesheet>
</head>
<body>

<SCRIPT language=JavaScript>
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</SCRIPT>
<script language="javascript">
<!--
function checkText(form)
{
var val=form.code.value;
var regexp = new RegExp("[0-9]{7,}")
if(!regexp.test(val))
{
alert('对不起!请输入数字,确保你输入了正确的奖券编号!');
form.code.focus();
return false;
}
else
return false;
}
function inputList(val)
{


window.parent.document.all.form2.codeList.add(new Option(val,val));
document.all.form1.code.value="";
return false;

}
//-->
</script>
<script language="javascript" event="onkeydown" for="document">
<!--
if(event.keyCode==13)
{
return false;
}
//-->
</script>


<table border="0" align="center" cellpadding="0" cellspacing="0">
<form method="post" id="form1" name="form1" onSubmit="checkText(this)" >
<tr>
<td width="69" height="40" align="left" valign="middle"><strong>奖券编号:</strong></td>
<td width="297" align="center" bgcolor="#FFFFFF"><input name="code" type="text" id="code" class="inputsty"/></td>
<td width="100" align="center" bgcolor="#FFFFFF"><input type="submit" name="submit" value="增加" /></td>
</tr>
</form>
</table>
</body>
</html>
<%
'scardid=session("scardid")
set rscode=server.CreateObject("adodb.recordset")
ticketID=trim(request.Form("code"))

submit=Request.Form("submit")
if submit="增加" then
sqlcode="select * from ticket where T_flag=0 and T_ticketID='"&ticketID&"'"
rscode.open sqlcode,conn,1,1

if rscode.eof and rscode.bof then
response.write("<script>alert('没有找到,请检查以确保输入无误');</script>")
else

Response.Write("<script>inputList('"& ticketID &"');</script>")
response.Write("找到")
end if

end if
rscode.close
set rscode=nothing
%>


2007-04-12 10:07
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

这个按钮提交第一个表单?
<input type="submit" name="submit" value="提交到数据库">

2007-04-12 10:08
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
得分:0 
以下是引用yms123在2007-4-12 10:08:22的发言:

这个按钮提交第一个表单?
<input type="submit" name="submit" value="提交到数据库">

这个按钮提交是第二个表单


2007-04-12 10:13
lollipop
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-4-11
收藏
得分:0 
第一个表单所作的操作是从数据库中找出上网卡号存在的用户,然后把用户信息提交到本页面,确定兑换积分后,第二个表单才显示出来(开始做第一个表单时,第二个表单是隐藏的),第二个表单的操作是把输入单行文本框中的内容和数据库检验,如果存在,则把文本框中的内容传到多选列表框中,先保留,然后再从单行文本框中输入,再检验数据库,如果存在,则继续传值到多选 列表框 中,直到输入完毕,最后提交到数据库,就是把列表框中存在的数据对数据库中对应更新。

2007-04-12 10:19
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 

那个人认为就得把地一个表单得数据进行传递提交。

2007-04-12 10:25
快速回复:谁来帮我一下!!!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.055018 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved