源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

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

  • 时间:2022-12-09 08:46 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:在dropDownList中实现既能输入一个新值又能实现下拉选的代码
aspx:
[u]复制代码[/u] 代码如下:
<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:
[u]复制代码[/u] 代码如下:
page_load() { if (!IsPostBack) { workerno_list.Attributes["onchange"] = "addTxtTanto(this.options[selectedIndex].innerText)"; } }
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部