| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 821 人关注过本帖
标题:让人头疼的问题联动菜单回显和修改
只看楼主 加入收藏
赫景洋
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-3-21
收藏
 问题点数:0 回复次数:0 
让人头疼的问题联动菜单回显和修改

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%if session("adminuser")="" or session("adminpassword")="" or session("houtai") <> "houtai" then
response.write "请刷新页面,重新登录"
response.End
end if
%>
<!--#include file="conn.asp" -->
<%set conn=server.CreateObject("adodb.connection")
conn.open connstrinn%>
<!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=gb2312" />
<title>物品填加</title>
<link href="../style/css.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style1 {
font-family: Arial, Helvetica, sans-serif;
font-style: italic;
}
.style5 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 12pt;}
-->
</style>
</head>

<body>
<form id="form1" name="form1">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td height="23" bgcolor="#009900" class="text1"><div align="center">
<span class="style5">Edit</span>
</div></td>
<td height="23" colspan="2" bgcolor="#DFFFBF"><span class="style1">Edit</span></td>
</tr>
<tr>
<td width="12%" height="23" bgcolor="#DFFFBF" class="text1"><div align="right">物品名称</div></td>
<td height="23" colspan="2" bgcolor="#F6F6F6">
<input name="name" type="text" class="tex" id="name" value="<%=request("name")%>"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="12%" height="22" class="text1"><div align="right">类别</div></td>
<td width="48%" height="22">

<!--//////武器二级连动开始++++++++++++-->

<script language = "JavaScript">
aaa=new Array();
<%
Dim i
i=0
set rw=server.createobject("adodb.recordset")
sql="select * from subcategory"
rw.open sql,conn,1,3
do while not rw.eof
%>
aaa[<%=i%>]=new Array("<%=rw("subcatename")%>","<%=rw("categoryid")%>","<%=rw("itemsubcate")%>");
<%
i=i+1
rw.movenext
loop
rw.close
%>
var y=function bbb(daid)

{

document.all.xi.length=0;
var daid=daid;
var i;
for(i=0;i<aaa.length;i++)
{
if(aaa[i][1]==daid)
{
var newOption5=new Option(aaa[i][0],aaa[i][2]);
document.all.xi.add(newOption5);
}
}
}
</script>


<select name="da" class="tex" ID="da" onChange="bbb(document.all.da.options[document.all.da.selectedIndex].value)">
<option>请选择</option>
<%
sql="select * from category"
rw.open sql,conn,1,3

do while not rw.eof
%>
<option value="<%=rw("categoryID")%>"><%=rw("cateName")%></option>
<%
rw.movenext
loop
rw.close
set rw=nothing
%>
</select>
<!--默认显示大类-->
<script>
var fm=document.forms(0)
for (i=0;i<fm.da.options.length;i++){
if(fm.da.options[i].value=="<%=request("1category")%>"){fm.da.options[i].selected=true;break;}

}
</script>
<select name="xi" class="tex" ID="xi">
<option>请选择</option>
</select>


<!--//////武器二级连动结束++++++++++++--> </td>
<td width="40%" height="22">职业</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="12%" height="22" class="text1"><div align="right">拍卖行</div></td>
<td width="48%" height="22">
<!--//////拍卖行三级连动开始++++++++++++-->
<script language = "JavaScript">
<!--第二级数组阵列-->
sall=new Array();
<%
Dim b
b=0
set rs=server.createobject("adodb.recordset")
sql="select * from ahmid"
rs.open sql,conn,1,3
do while not rs.eof
%>
sall[<%=b%>]=new Array("<%=rs("AHmidName")%>","<%=rs("ahmaxid")%>","<%=rs("ahmidid")%>");
<%
b=b+1
rs.movenext
loop
rs.close
%>

<!--第三级数组阵列-->
trll=new Array();
<%
Dim s
s=0
set rt=server.createobject("adodb.recordset")
sql="select * from ahmin"
rt.open sql,conn,1,3
do while not rt.eof
%>
trll[<%=s%>]=new Array("<%=rt("AHminName")%>","<%=rt("ahmidid")%>","<%=rt("ahmaxid")%>");
<%
s=s+1
rt.movenext
loop
rt.close
%>

function changeselect(selvalue)

{

document.all.pai2.length=0;
var selvalue=selvalue;
var i;
for(i=0;i<sall.length;i++)
{
if(sall[i][1]==selvalue)
{
var newOption1=new Option(sall[i][0],sall[i][2]);
document.all.pai2.add(newOption1);
}
}
}
<!--第二个过程-->
function changee(san)

{

document.all.three.length=0;
var san=san;
var i;
for(i=0;i<trll.length;i++)
{
if(trll[i][1]==san)
{
var newOption3=new Option(trll[i][0],trll[i][2]);
document.all.three.add(newOption3);
}
}
}
</script>


<select name="pai" class="tex" ID="pai" onChange="changeselect(document.all.pai.options[document.all.pai.selectedIndex].value)">
<option>请选择</option>
<%
sql="select * from AHMAX"
rs.open sql,conn,1,3
do while not rs.eof
%>
<option value="<%=rs("AHmaxID")%>"><%=rs("AHmaxName")%></option>
<%
rs.movenext
loop
rs.close
set rs=nothing
set rt=nothing
%>
</select>
<!--默认显示拍卖行-->
<script>
var fm=document.forms(0)
for (i=0;i<fm.pai.options.length;i++){
if(fm.pai.options[i].text=="<%=request("pai")%>"){fm.pai.options[i].selected=true;break;}

}
</script>
<select name="pai2" class="tex" ID="pai2" onChange="changee(document.all.pai2.options[document.all.pai2.selectedIndex].value)">
<option>请选择</option>
</select>


<select name="three" class="tex" ID="three">
<option>请选择</option>
</select>
<!--//////拍卖行三级连动结束++++++++++++--></td>
<td width="40%" rowspan="6" valign="top"><a href="javascript:window.location=('a.asp?'+pai2.value+'')"></a><span class="text1">
<input type="checkbox" value="所有职业" name="checkb" id="checkb">--所有职业<br>
<%set rr=server.CreateObject("adodb.recordset")
sql="select * from job"
rr.open sql,conn,1,3
do while not rr.eof%>
<input type="checkbox" value="<%=rr("jobname")%>" name="checkb">
<%=rr("jobname")%><br />
<%
rr.movenext
loop
rr.close%>
<script>

var spl="<%=request("job")%>";

var fm=document.forms(0)
var strArray=new Array();
strArray=spl.split(", ");

for(s=0;strArray[s]!=undefined;s++){

var ipt=document.getElementsByTagName("input");

for (i=0;i<fm.checkb.length+1;i++){

if(ipt[i].type=='checkbox') {
if(strArray[s]==ipt[i].value)
{ipt[i].checked=true;}

}


}

}

</script>
</span></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="12%" height="22" class="text1"><div align="right">种族</div></td>
<td width="48%" height="22"><select name="race" class="tex" id="race">
<option>请选择</option>
<%sql="select * from race"
rr.open sql,conn,1,3
do while not rr.eof%>
<option value=<%=rr("raceID")%>><%=rr("raceName")%></option>
<%rr.movenext
loop
rr.close
set rr=nothing%>
</select>
<script>
var fm=document.forms(0)
for (i=0;i<fm.race.options.length;i++){
if(fm.race.options[i].text=="<%=request("race")%>"){fm.race.options[i].selected=true;break;}

}
</script> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="23" class="text1"><div align="right">属性</div></td>
<td height="23"><textarea name="product" cols="50" rows="6" class="tex" id="product"><%=request("product")%></textarea></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="22" class="text1"><div align="right">等级需求</div></td>
<td height="22"><input name="djxq" type="text" class="tex" id="djxq" value="<%=request("djxq")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="22" class="text1"><div align="right">何处获得</div></td>
<td height="22"><input name="whereget" type="text" class="tex" id="whereget" value="<%=request("whereget")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="22" class="text1"><div align="right">获得方法</div></td>
<td height="22"><input name="howget" type="text" class="tex" id="howget" value="<%=request("howget")%>">
<input type="hidden" name="itid" id="itid" value="<%=request("itemID")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="22" colspan="3" bgcolor="#CCCCCC" class="text1">
<div align="left">
<script>//alert(document.form2.a.length)
function cece(){

document.form1.action=('proexe.asp?hod=update&name='+form1.name.value+'&xi='+document.getElementById('xi').options[document.getElementById('xi').selectedIndex].innerText+'&pai='+document.getElementById('pai').options[document.getElementById('pai').selectedIndex].innerText+'&pai2='+document.getElementById('pai2').options[document.getElementById('pai2').selectedIndex].innerText+'&three='+document.getElementById('three').options[document.getElementById('three').selectedIndex].innerText+'&race='+document.getElementById('race').options[document.getElementById('race').selectedIndex].innerText+'&product='+form1.product.value+'&djxq='+form1.djxq.value+'&whereget='+form1.whereget.value+'&howget='+form1.howget.value+'&itemid='+form1.itid.value);
document.form1.method="post";
document.form1.submit();
}
</script>
<input name="Submit5" type="button" class="butt" value="《后退" onclick="history.back();" />
<input name="button" type="button" class="butt" onclick="cece()" value="提交">
<input name="Submit" type="reset" class="butt" value="初始">
<script>
function wins()
{
var winopen=window.open("EditPeifang.asp?itid="+form1.itid.value+"","_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=300,left=590,width=600,height=500");
}

</script>
<script>
function winss()
{
var winopen=window.open("EditQita.asp?itid="+form1.itid.value+"","_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=300,left=590,width=600,height=500");
}

</script>
<input name="Submit3" type="button" class="butt" value="修改配方" onclick="wins()">
<input name="Submit4" type="button" class="butt" value="修改其它用途" onclick="winss()">
<input name="Submit2" type="button" class="butt" onclick="window.location=('seledit1.asp')" value="回到查找物品页面">
</div></td></tr>
</table>
</form>


</body>
</html>

搜索更多相关主题的帖子: 菜单 头疼 
2007-03-21 14:31
快速回复:让人头疼的问题联动菜单回显和修改
数据加载中...
 
   



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

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