<asp:dropdownlist id="ddlBusCode" runat="server"></asp:dropdownlist>
如何用JS获取下拉框的值?
如何用JS获取下拉框的值?
解决方案 »
- 怎么通过继承来扩展gridview的功能呢?
- 下面这段代码为什么不能写Cookie?
- 一个.net的小问题!
- 急!请教MapXtreme 2005 6.6 + VS.net 2005 “索引超出范围“的问题
- 使cookies随浏览器关闭而失效?
- 在ACCESS2000数据库表中插入数据,发生错误,请高手们指导
- 请教各位高手
- 提示"“text”不是“String”的成员。是怎么回事?大哥大姐们帮帮我吧:(
- 奇怪啊!VS.Net安装不上了!
- 是个难题
- 如何判断客户端是否下载成功?
- 看了MSDN, 还是不明白RegisterRequiresPostBack 和 RegisterRequiresRaiseEvent 方法干什么用的!!!
var index = ddl.seletedIndex;var Value = ddl.options[index].value;
var Text = ddl.options[index].text;
var aaa=ddlBusCode.options[this.selectedIndex].value;
var aaa=ddlBusCode.options[ddlBusCode.selectedIndex].value;
var ddl = document.getElementById("ddlBusCode")
var index = ddl.seletedIndex;var Value = ddl.options[index].value;
var Text = ddl.options[index].text;
var tempksrq=ksobj.options[ksobj.selectedIndex].value;
我用了报错,说options[...].VLLUE为空
------------------------------------------------------------------------------------
为什么文本框不能显示出来呢??????
------------------------------------------------------------------------------------
为什么文本框不能显示出来呢??????
string dd= c.options[c.selectedIndex].value
------------------------------------------------------------------------------------
为什么文本框不能显示出来呢??????
opt = new Option(text,value);
objSel2.options[indexvalue] = opt;
另要注意大小写
var pindex = province.selectedIndex;
var pValue = province.options[pindex].value;
var pText = province.options[pindex].text;
那怎样把获取下拉框的值在前台放进文本框呢????
大家帮忙想一想
-----------------------------------------
var province=document.getElementById("DropDownList1");
var pindex = province.selectedIndex;
var pValue = province.options[pindex].value;
var pText = province.options[pindex].text;document.getElementById("<%=TextBox1.ClientID%>").innerText=pValue+"|"+pText;
function show3(ddl)
{
document.getElementById("txtName").value=ddl.options[ddl.selectedIndex].value;
}
</script>
<asp:DropDownList ID="ddlName" runat="server" OnChange="show3(this)">
<asp:ListItem Value="Jack"></asp:ListItem>
<asp:ListItem Value="Tom"></asp:ListItem>
<asp:ListItem Value="Mike"></asp:ListItem>
</asp:DropDownList>
-----------------------
结贴给分!!!!不结贴就不尊重别人的劳动成果!
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>