本篇內(nèi)容主要講解“在dropDownList中怎么實(shí)現(xiàn)既能輸入一個新值又能實(shí)現(xiàn)下拉的選項”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實(shí)用性強(qiáng)。下面就讓小編來帶大家學(xué)習(xí)“在dropDownList中怎么實(shí)現(xiàn)既能輸入一個新值又能實(shí)現(xiàn)下拉的選項”吧!

aspx:
復(fù)制代碼 代碼如下:
<div id="selDiv" ><%--left:279px; top:167px"--%>
<asp:DropDownList ID="workerno_list" runat="server" Width="110px" ></asp:DropDownList>
</div>
<asp:TextBox ID="workerno_value" runat="server" 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:
復(fù)制代碼 代碼如下:
page_load()
{
if (!IsPostBack)
{
workerno_list.Attributes["onchange"] = "addTxtTanto(this.options[selectedIndex].innerText)";
}
}
到此,相信大家對“在dropDownList中怎么實(shí)現(xiàn)既能輸入一個新值又能實(shí)現(xiàn)下拉的選項”有了更深的了解,不妨來實(shí)際操作一番吧!這里是創(chuàng)新互聯(lián)建站,更多相關(guān)內(nèi)容可以進(jìn)入相關(guān)頻道進(jìn)行查詢,關(guān)注我們,繼續(xù)學(xué)習(xí)!
本文名稱:在dropDownList中怎么實(shí)現(xiàn)既能輸入一個新值又能實(shí)現(xiàn)下拉的選項-創(chuàng)新互聯(lián)
標(biāo)題來源:http://chinadenli.net/article38/hhppp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供響應(yīng)式網(wǎng)站、網(wǎng)站維護(hù)、網(wǎng)站導(dǎo)航、外貿(mào)網(wǎng)站建設(shè)、網(wǎng)站設(shè)計公司、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容