欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

dropdownlist中既可以输入又可以下拉列表 博客分类: ASP.NET ASP.NET 

程序员文章站 2024-03-15 20:46:36
...
前台页面源码:
div id="selDiv"
                                style=" z-index:100; visibility:visible; clip:rect(0px 110px 80px 92px); position:absolute; top: 95px; left: 862px;" ><%--left:279px; top:167px"--%>
                               <asp:DropDownList ID="ddlType_Field" runat="server" style="z-index:-1" Width="110px" DataSource="<%#  getTypeFieldInfo() %>"  DataValueField="Type_Field" DataTextField="Type_Name"  OnSelectedIndexChanged="ddlType_Field_Selected_Index_Changed"  AutoPostBack= "true"></asp:DropDownList>
                          </div>
                          <asp:TextBox ID="txtType_Field_Text" runat="server"
                                style=" z-index:103px; position:absolute; top: 95px; left: 862px;"
                                Font-Size="10" Width="93px" MaxLength ="50" Height="22px" ></asp:TextBox>
                          <asp:TextBox ID="txtType_Field_value" runat="server" style=" z-index:103px; position:absolute" Font-Size="10" Width="93px" MaxLength ="50" Height="22px" Visible="false"></asp:TextBox>

javascript代码:
<script type="text/javascript" language="javascript">
        function addTxtTanto(val) {
            document.getElementById("txtType_Field_value").value = val;
            document.getElementById("txtType_Field_value").select();
        }
    </script>
相关标签: ASP.NET