时间:2021-07-01 10:21:17 帮助过:7人阅读
- <br><div id="selDiv" style=" z-index:100; visibility:visible; clip:rect(0px 110px 80px 92px); position:absolute"><%--left:279px; top:167px"--%> <br><asp:DropDownList ID="workerno_list" runat="server" style="z-index:-1" Width="110px" ></asp:DropDownList> <br></div> <br><asp:TextBox ID="workerno_value" runat="server" style=" z-index:103px; position:absolute" Font-Size="10" Width="93px" MaxLength ="50" Height="22px"></asp:TextBox> <br><script> <br>function addTxtTanto(va) <br>{ <br>document.getElementById("workerno_value").value=va; <br>document.getElementById("workerno_value").select(); <br>} <br></script> <br> <br>aspx.cs: <br><span><u></u></span> 代码如下:<pre class="brush:php;toolbar:false layui-box layui-code-view layui-code-notepad"><ol class="layui-code-ol"><li><br>page_load() <br>{ <br>if (!IsPostBack) <br>{ <br>workerno_list.Attributes["onchange"] = "addTxtTanto(this.options[selectedIndex].innerText)"; <br>} <br>} <br></li><li> </li><li> </li></ol></pre>