音效素材.NET编程

在dropDownList中实现既能输入一个新值又能实现下拉选的代码

aspx:
复制代码 代码如下:

<div id="selDiv" style=" z-index:100; visibility:visible; clip:rect(0px 110px 80px 92px); position:absolute"><%--left:279px; top:167px"--%>
<asp:DropDownList ID="workerno_list" runat="server" style="z-index:-1" Width="110px" ></asp:DropDownList>
</div>
<asp:TextBox ID="workerno_value" runat="server" style=" z-index:103px; position:absolute" Font-Size="10" Width="93px" MaxLength ="50" Height="22px"></asp:TextBox>
<script>
function addTxtTanto(va)
{
document.getElementById("workerno_value").value=va;
document.getElementById("workerno_value").select();
}
</script>

aspx.cs:
复制代码 代码如下:

page_load()
{
if (!IsPostBack)
{
workerno_list.Attributes["onchange"] = "addTxtTanto(this.options[selectedIndex].innerText)";
}
}

注:资源为互联网收集,仅供学习与参考,请勿用于商业用途,如有疑问请联系人工客服QQ:9616463

相关阅读

热文排行

点击查看更多内容
全站导航

音效

教程

资讯

美图