日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

dropdownlist可以多选。类似的例子。。。

發(fā)布時間:2025/3/15 编程问答 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 dropdownlist可以多选。类似的例子。。。 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

類似的在dropdownlist中可以實現(xiàn)多選擇多個項。

主要是用JS 和div控制,實際上右邊的那個是圖片。

HTML

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="下拉框多選效果.aspx.cs" Inherits="wsw_測試_下拉框多選效果" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"><title>無標題頁</title><style type="text/css">.style1{width: 100%;}</style><script language="javascript" type="text/javascript">var timoutID;//大隊var panduan1=1;function ShowMList(){var divRef = document.getElementById("divssddList");divRef.style.display = "block";}function HideMList(){document.getElementById("divssddList").style.display = "none"; if(panduan1==2){document.getElementById("btnssdd").click();}panduan1=1;}function FindSelectedItems(sender) {var cblstTable = document.getElementById(sender.id);var checkBoxPrefix = sender.id + "_";var noOfOptions = cblstTable.rows.length;var selectedText = "";for (i = 0; i < noOfOptions; ++i) {if (document.getElementById(checkBoxPrefix + i).checked) {if (selectedText == "") {selectedText = document.getElementById(checkBoxPrefix + i).parentNode.innerText;}else {selectedText = selectedText + "," + document.getElementById(checkBoxPrefix + i).parentNode.innerText;}}}document.getElementById("texssdd").value = selectedText;panduan1=2;}//小隊var panduan2=1;function ShowMssxd(){var divRef = document.getElementById("divssxdList");divRef.style.display = "block";}function HideMssxd(){document.getElementById("divssxdList").style.display = "none"; if(panduan2==2){document.getElementById("btnssxd").click();}panduan2=1;}function FindSelectedssxd(sender) {var cblstTable = document.getElementById(sender.id);var checkBoxPrefix = sender.id + "_";var noOfOptions = cblstTable.rows.length;var selectedText = "";for (i = 0; i < noOfOptions; ++i) {if (document.getElementById(checkBoxPrefix + i).checked) {if (selectedText == "") {selectedText = document.getElementById(checkBoxPrefix + i).parentNode.innerText;}else {selectedText = selectedText + "," + document.getElementById(checkBoxPrefix + i).parentNode.innerText;}}}document.getElementById("texssxd").value = selectedText;panduan2=2;}//分類盤點var panduan3=1;function ShowPdlx(){var divRef = document.getElementById("divPdlxList");divRef.style.display = "block";}function HidePdlx(){document.getElementById("divPdlxList").style.display = "none"; if(panduan3==2){document.getElementById("btnPdlx").click();}panduan3=1;}function FindPdlxItems(sender) {var cblstTable = document.getElementById(sender.id);var checkBoxPrefix = sender.id + "_";var noOfOptions = cblstTable.rows.length;var selectedText = "";for (i = 0; i < noOfOptions; ++i) {if (document.getElementById(checkBoxPrefix + i).checked) {if (selectedText == "") {selectedText = document.getElementById(checkBoxPrefix + i).parentNode.innerText;}else {selectedText = selectedText + "," + document.getElementById(checkBoxPrefix + i).parentNode.innerText;}}}document.getElementById("texPdlx").value = selectedText;panduan3=2;}</script> </head> <body><form id="form1" runat="server"><div><table class="style1"><tr><td width="15%" height="25" align="left" valign="middle"><asp:Label ID="lbssdd" runat="server" Text=""></asp:Label><asp:Panel ID="pnlssdd" runat="server" ><div id="divssdd" runat="server" οnmοuseοver="clearTimeout(timoutID);" οnmοuseοut="timoutID = setTimeout('HideMList()', 75);"><table border="0" cellpadding="0" cellspacing="0"><tr><td align="right"><asp:TextBox ID="texssdd" runat="server" οnclick="ShowMList()" Width="150px"></asp:TextBox></td><td align="left"><img id="Img1" alt="" runat="server" src="drop.gif" οnclick="ShowMList()" align="left" /></td></tr><tr><td colspan="2"><div runat="server" id="divssddList" class="DivCheckBoxList"><asp:CheckBoxList ID="lstssdd" runat="server" Width="165px" Font-Size="12px" CssClass="CheckBoxList"onclick="FindSelectedItems(this);"><asp:ListItem>1</asp:ListItem><asp:ListItem>2</asp:ListItem></asp:CheckBoxList></div></td></tr></table></div></asp:Panel><asp:Button ID="btnssdd" runat="server" Text="btnssdd" CssClass="yincang" Visible="false" /></td></tr></table></div></form> </body> </html>

這樣就能簡單的實現(xiàn)一些功能

轉(zhuǎn)載于:https://www.cnblogs.com/smile-wei/archive/2012/04/09/2438950.html

總結(jié)

以上是生活随笔為你收集整理的dropdownlist可以多选。类似的例子。。。的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。