一个求得ID的问题。急。

WUXP 2004-04-01 03:02:11
当我从那个下拉列表框, 选择一个项 ,,我怎么得到它的ID
那个下拉列表框的name 是bighy ,
我尝试用 request("bighy") 是空的
用request("bighy").value也是空的 ...
我要得到它的ID 就一切
...全文
92 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
benben168 2004-04-01
  • 打赏
  • 举报
回复
up
loveweb 2004-04-01
  • 打赏
  • 举报
回复
什么意思?
request("bighy") 就可以得到啊
<form name="form" method="post" action="a.asp">
<select name="bighy">
<option value="" selected>请选择</option>
<option value="1">不限</option>
<option value="2">不限</option>
</select>
</form>
a.asp中
request("bighy") 就可得到值
jiffer 2004-04-01
  • 打赏
  • 举报
回复
<%
lx=request("lx")
%>


<form name="test" method="post">
<font size="2" color="#0000FF"> 请选择产品:</font>
<select size=1 name=lx onchange="Javascript:test.submit()" style="color: #3399FF; border-bottom: 1px solid #3399FF; background-color: #FFFFFF">
<%
sql="select * from cplx order by id desc"
rs.open sql,conn,1,1
%>
<option selected>--请选择--</option>
<%
for i=1 to rs.recordcount
%>
<option <%if rs("lx")=lx then response.write "selected"%> value="<%=rs("lx")%>"><%=rs("lx")%></option>

<%
rs.MoveNext
Next

rs.close
%>
</select>
改一下就行了
zwonline99 2004-04-01
  • 打赏
  • 举报
回复
一个例子
<html>
<head>
<title>dericti</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="20.asp">
<p align="center">derition:
<select name="abc">
<option value="a">1</option>
<option value="b">2</option>
<option value="c">3</option>
</select>
</p>
<p align="center">
<input type="submit" name="Submit" value="提交">
</p>
</form>
<p> </p>
<p> </p>
</body>
</html>


20.asp
<% @ language="vbscript"%>
<html>
<head>
<title>name</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
dim tom
tom=request.form("abc")
if tom="a" then
response.redirect"a.htm"
end if
if tom="b" then
response.redirect"b.htm"
end if
if tom="c" then
response.redirect"c.htm"
end if
%>
</body>
</html>
  • 打赏
  • 举报
回复
改正:

<select name="bighy" onchange="form1.hiddenfield.value=this.options[this.selectedIndex].value">
<option value=333>aa
<option value=444>bb
<option value=555>cc
</select>
cjf1009 2004-04-01
  • 打赏
  • 举报
回复
request("bighy")就得到value值了。
不知道你说的id是什么意思。
若白师妹 2004-04-01
  • 打赏
  • 举报
回复
asp:
<%
tmp=request.form("bighy")
response.write tmp
%>
  • 打赏
  • 举报
回复
如果这样不行的话可以写一个函数对当前业面的一个hidden域赋值为选定的id
<form name="form1" method="post" action="2.asp">
<select name="bighy" onchange="form1.hiddenfield.value=this.options[selectedIndex.value">
<option value=333>
<option value=444>
<option value=555>
</select>
<input type="hidden" name="hiddenfield">
</form>

2.asp中request.form("hiddenfield")
若白师妹 2004-04-01
  • 打赏
  • 举报
回复
你要在客戶端嗎?
<form name=form>
<select name=bighy onchange="javascript:check()">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
</select>

<script language="JavaScript">
<!--
function check()
{
var url = form.bighy.options[form.bighy.selectedIndex].value;
alert (url);
}

// -->
</script>
</form>
MonkeyDHua 2004-04-01
  • 打赏
  • 举报
回复
下拉框有楼上这样做

再request.form("bighy")不就行了??
5icool 2004-04-01
  • 打赏
  • 举报
回复
<select name="bighy">
<option value="<%=rs("id")%>" selected><%=rs("bighy")%></option>
</select>

28,409

社区成员

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

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