下拉菜单触发文本框

jiaxz 2005-09-28 05:46:54
有一组数组,
a1,b1
a2,b2
a3,b4
...
下拉菜单中显示a1,a2,a3...,当选a1时,旁边的文本框内显示b1,
当选a2时,旁边的文本框内显示b2......
且文本框内容不可修改,但可以提交。
...全文
186 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiqunet 2005-10-18
  • 打赏
  • 举报
回复

不是“没人能解决”,而是开始时你没把问题陈述清楚!

<%
dim a(4),b(4)
a(1)="a1"
a(2)="a2"
a(3)="a3"
a(4)="a4"
b(1)="b1"
b(2)="b2"
b(3)="b3"
b(4)="b4"
%>
<script>
var barr=new Array();
<%
for i=1 to ubound(b)
response.write"barr[" & i-1 & "]=""" & b(i) & """;" & vbcrlf
next
%>
</script>
<form name="form1">
<SELECT NAME="s1" onchange="document.all.t1.value=barr[selectedIndex];">
<%for i=1 to ubound(a)%>
<option value="<%=a(i)%>"><%=a(i)%>
<%next%>
</SELECT>
<INPUT TYPE="text" NAME="t1" readonly="true">
</form>
qiqunet 2005-10-18
  • 打赏
  • 举报
回复
<%
'set myexcell=CreateObject("Excel.Application")
'set mywork=myexcell.Workbooks.Open(server.MapPath("test.xls"),,,,"1")
'myexcell.DisplayAlerts=false
'set Activesheet=myexcell.sheets("sheet1")
'Activesheet.cells(1,1)="file was open at " & now()
'response.Redirect("test.xls")
'mywork.save
'mywork.close
'set mywork=nothing
'set myexcell=nothing

%>
<%
dim a(4),b(4)
a(1)="a1"
a(2)="a2"
a(3)="a3"
a(4)="a4"
b(1)="b1"
b(2)="b2"
b(3)="b3"
b(4)="b4"
%>
<script>
var barr=new Array();
<%
for i=1 to ubound(b)
response.write"barr[" & i-1 & "]=""" & b(i) & """;" & vbcrlf
next
%>
</script>
<form name="form1">
<SELECT NAME="s1" onchange="document.all.t1.value=barr[selectedIndex];">
<%for i=1 to ubound(a)%>
<option value="<%=a(i)%>"><%=a(i)%>
<%next%>
</SELECT>
<INPUT TYPE="text" NAME="t1" readonly="true">
</form>
jiaxz 2005-10-18
  • 打赏
  • 举报
回复
高手们快帮我呀。
jiaxz 2005-10-08
  • 打赏
  • 举报
回复
没人能解决吗?高手们快帮我呀。
jiaxz 2005-09-29
  • 打赏
  • 举报
回复
可是表单传过去的数据s1和t1都是同一个值,即b(i),如何让s1=a(i),t1=b(i)?
zhuowei 2005-09-29
  • 打赏
  • 举报
回复
<form action="" method="post" name=form1>
<select name="select1" onChange="javascript:document.form1.input1.value=options[selectedIndex].value;">
<option value="">===</option>
<option value="b1">a1</option>
<option value="b2">a2</option>
<option value="b3">a3</option>
</select>
<input type="text" name="input1" size=10>
</form>
qiqunet 2005-09-28
  • 打赏
  • 举报
回复



<INPUT TYPE="text" NAME="t1" readonly="true">




legend1970 2005-09-28
  • 打赏
  • 举报
回复
<%
dim a(4),b(4)
a(1)="a1"
a(2)="a2"
a(3)="a3"
a(4)="a4"
b(1)="b1"
b(2)="b2"
b(3)="b3"
b(4)="b4"

%>
<form name="form1">
<SELECT NAME="s1" onchange=javascript:document.form1.t1.value=this.value>
<%for i=1 to ubound(a)%>
<option value="<%=b(i)%>"><%=a(i)%>
<%next%>
</SELECT>
<INPUT TYPE="text" NAME="t1">
</form>
iammtm2671 2005-09-28
  • 打赏
  • 举报
回复
<select name="select" class="select" onchange="document.text.value=数组的值;">

28,391

社区成员

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

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