这个事件怎么处理?

ydiandian 2002-08-20 05:22:46
1、在ASP中,在输入数据表中内容的时候!有个表AA个内容是这样的!
他的主键是三个字段的祝贺:如字段A,B,C,其中A,B是外键,其内容要参照另外一个表BB的主键A,B。
2、这时候在输入AA内容的时候,我只能把BB表的A,B两个字段的内容都拿出来。
但实际上的需要是,两个字段的内容不能同时拿出来,应该是拿出其中的一个,如A
当我在放A内容的下拉列表框中选中需要的内容时,触发一个事件,这个过程将与当前选中内容相关的BB表中的B字段的内容拿出来放到另一个列表框中,这个事件怎么处理,我对ASP中处理表单元素的事件不知道的!
谢谢
...全文
31 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ydiandian 2002-08-22
  • 打赏
  • 举报
回复
回去看看!
yonghengdizhen 2002-08-20
  • 打赏
  • 举报
回复
其实是可以一次拿出来的(如果数据不是狂多的话)
有客户端脚本处理.
那样免去了每选一次向服务器请求一次.
JavaCoffee 2002-08-20
  • 打赏
  • 举报
回复
我这里有一个类似的例子,供你参考:
假如当前文件名为“fileborrowdatafind.asp”
<!--#include file="数据库连接语句文件.asp"-->
<!--#include file="相关函数文件.asp"-->
<%
unitid=request.form("unit")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title></title>
<link rel="stylesheet" href="news.css">
<script language=vbscript>
sub changetypefind
document.frmfilefind.action="fileborrowdatafind.asp"
document.frmfilefind.submit
end sub
sub datefind_check
if not isdate(document.frmfilefind.begindate.value) then
msgbox "起始日期项不是日期型数据!请返回修改。"
document.frmfilefind.begindate.select()
document.frmfilefind.begindate.focus()
exit sub
end if
if not isdate(document.frmfilefind.enddate.value) then
msgbox "终止日期项不是日期型数据!请返回修改。"
document.frmfilefind.enddate.select()
document.frmfilefind.enddate.focus()
exit sub
end if
if document.frmfilefind.begindate.value > document.frmfilefind.enddate.value then
msgbox "起始日期大于终止日期!请返回修改。"
document.frmfilefind.begindate.select()
document.frmfilefind.begindate.focus()
exit sub
end if
document.frmfilefind.submit
end sub
</script>
</head>
<body>
<div align="center">
<form name="frmfilefind" method="POST" action="fileborrowdatafind_result.asp">
<p> </p>
<table border="0" cellspacing="0" cellpadding="0" width="400" align="center">
<tr>
<td width="400">
<p align="center"><font color="red" size="2"><br>
借资信息查询</font>
<hr size="1" color="#000080">
</td>
</tr>
<tr>
<td width="400">
 借阅日期: <input type="text" name="begindate" value="<%=cstr(Year(now) - 1) & "-" & month(now) & "-" & day(now)%>" size="9">

<input type="text" name="enddate" value="<%=Year(now) & "-" & month(now) & "-" & day(now)%>" size="9"><br>
<br>
 是否归还:<input type="radio" value="no" name="returnflag" checked>未归还
<input type="radio" value="yes" name="returnflag">已归还<br>
<br>
 借阅单位: <select size="1" name="unit" onchange="changetypefind">
<option value="%" <%if unitid="" then response.write "selected" %>>全部</option>
<%
sql_unit="SELECT * FROM tfilepaun WHERE tfilepaun.inuse = 1"
rs2.open sql_unit,conn
do while not rs2.eof
%>
<option value="<%=rs2("unit_id")%>" <%if unitid<>"" and unitid<>"%" then
if cint(rs2("unit_id"))=cint(unitid) then
response.write "selected"
end if
end if%>><%=rs2("unitname")%></option>
<%
rs2.movenext
loop
rs2.close
%>
</select>
借阅人:<select size="1" name="person">
<option value="%">全部</option>
<%
if unitid="" or unitid="%" then
sql_dept="SELECT filepaper_id,name FROM tfilepaper "
else
sql_dept="SELECT filepaper_id,name FROM tfilepaper where unit_id=" & unitid
end if
rs2.open sql_dept,conn
do while not rs2.eof
%>
<option value="<%=rs2("filepaper_id")%>"><%=rs2("name")%></option>
<%
rs2.movenext
loop
rs2.close
%>
</select>
<br>
</tr>
<tr>
<td width="400">
<hr size="1" color="#000080">
</td>
</tr>
<tr>
<td width="400">
<p align="center">
<input type="button" value=" 查 询 " name="datefind" onclick="datefind_check">  
<input type="button" value=" 返 回 " name="datefind1" onclick="javascript:history.back();">
</td>
</tr>
</table> </form>
</div>
</body>
</html>

28,391

社区成员

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

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