最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

多選列表框動(dòng)態(tài)添加,移動(dòng),刪除,全選等操作的簡(jiǎn)單實(shí)例

 更新時(shí)間:2014年01月13日 10:18:24   作者:  
本篇文章主要是對(duì)多選列表框動(dòng)態(tài)添加,移動(dòng),刪除,全選等操作的簡(jiǎn)單實(shí)例進(jìn)行了介紹,需要的朋友可以過來參考下,希望對(duì)大家有所幫助

復(fù)制代碼 代碼如下:

<%
dim a
a = split(Request.Form("sourceList"),",")
Response.Write "Source:" & Request.Form("sourceList") & ubound(a) & "<br>Object:" & Request.Form("objectList") & "<br>"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Untitled Document</title>
<STYLE type=text/css>
.bgsubleft {
BACKGROUND-POSITION: center bottom; BACKGROUND-IMAGE: url(images/bgleft.gif); BACKGROUND-REPEAT: repeat-x
}
.bgsubleftn {
BACKGROUND-POSITION: left bottom; BACKGROUND-IMAGE: url(images/bgleftn.gif); BACKGROUND-REPEAT: no-repeat
}
</STYLE>
<script language="JavaScript" type="text/JavaScript">
function addSelectedList()
{
var objSource = form1.sourceList;
var objObject = form1.objectList;
var sourcelen = objSource.length ;
for(var i=0;i<sourcelen;i++){
    if (objSource.options[i].selected){
      if (!checkExist(objObject,objSource.options[i].value)){
        addtolist(objObject,objSource.options[i].text,objSource.options[i].value);
      }
    }
}
}

function addAllList()
{
var objSource = form1.sourceList;
var objObject = form1.objectList;
var sourcelen = objSource.length ;
for(var i=0;i<sourcelen;i++){
    if (!checkExist(objObject,objSource.options[i].value)){
      addtolist(objObject,objSource.options[i].text,objSource.options[i].value);
    }
}
}

function removeSelectedList(noRemoveValue)
{
var objObject = form1.objectList;
for (var i=0;i<objObject.length;i++){
    if (objObject.options[i].selected && objObject.options[i].value != noRemoveValue)
    {
      objObject.options.remove(i);
      removeList(noRemoveValue);break;
    }
}
}

function removeAllList(noRemoveValue)
{
var objObject = form1.objectList;
var objLen = objObject.length;
for (var i=0;i<objLen;i++){
    if ( objObject.options[i].value != noRemoveValue){
      objObject.options.remove(i);
      removeAllList(noRemoveValue);break;
    }
}
}

function selectedAll(obj)
{
for (var i=0;i<obj.length;i++){
    obj.options[i].selected = true;
}
}
function checkExist(obj,value)
{
var isExist = false;
for (var i=0;i<obj.length;i++){
    if (obj.options[i].value == value){
      isExist = true;
      break;
    }
}
return isExist;
}
function addtolist(obj,value,label){
obj.add(new Option(value,label));
}
</script>
</head>

<body bgcolor="#FFFFFF">
<form name="form1" action="temp.asp" method="post">
<table width="200" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td><select name="sourceList" size="10" multiple id="sourceList" style="width:150">
      <option value="a">1</option>
      <option value="b">2</option>
      <option value="c">3</option>
      <%
      for i = 6 to 20
        Response.Write("<option value=""" & i+200 & """>" & i+200 & "</option>" & vbcrlf)
      Next
      %>
    </select></td>
    <td><input name="add" type="button" id="add" value="Add" onclick="addSelectedList()" style="width:100"><br>
      <input name="add" type="button" id="add" value="Add all" onclick="addAllList()" style="width:100"><br>  
    <input name="add" type="button" id="add" value="Remove" onclick="removeSelectedList('a')" style="width:100"><br>
    <input name="add" type="button" id="add" value="Remove all" onclick="removeAllList('a')" style="width:100">
    <input name="add" type="button" id="add" value="Select all" onclick="selectedAll(form1.objectList)" style="width:100"></td>
    <td><select name="objectList" size="10" multiple id="objectList" style="width:150">
      <option value="a">1</option>
      <option value="d">4</option>
      <option value="e">5</option>
      <%
      for i = 6 to 20
        Response.Write("<option value=""" & i & """>" & i & "</option>" & vbcrlf)
      Next
      %>
    </select></td>
</tr>
<tr>
    <td></td>
    <td><input name="subm" type="submit" value="Submit" style="width:100"></td>
    <td>&nbsp;</td>
</tr>
</table>
</form>
</body>
</html>

相關(guān)文章

  • Leaflet?數(shù)據(jù)可視化實(shí)現(xiàn)地圖下鉆示例詳解

    Leaflet?數(shù)據(jù)可視化實(shí)現(xiàn)地圖下鉆示例詳解

    這篇文章主要為大家介紹了Leaflet數(shù)據(jù)可視化實(shí)現(xiàn)地圖下鉆示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-01-01
  • 微信jssdk用法匯總

    微信jssdk用法匯總

    這篇文章主要針對(duì)微信jssdk用法進(jìn)行匯總,通過ready接口處理成功驗(yàn)證、通過error接口處理失敗驗(yàn)證等內(nèi)容介紹,感興趣的小伙伴們可以參考一下
    2016-07-07
  • Bootstrap每天必學(xué)之導(dǎo)航組件

    Bootstrap每天必學(xué)之導(dǎo)航組件

    Bootstrap每天必學(xué)之導(dǎo)航組件,制作面包屑式導(dǎo)航、導(dǎo)航加下拉菜單效果,感興趣的小伙伴們可以參考一下
    2016-04-04
  • 微信小程序自定義輪播圖

    微信小程序自定義輪播圖

    這篇文章主要為大家詳細(xì)介紹了微信小程序自定義輪播圖,swiper dots默認(rèn)樣式修改,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2018-11-11
  • 建議大家看下JavaScript重要知識(shí)更新

    建議大家看下JavaScript重要知識(shí)更新

    建議大家看下JavaScript重要知識(shí)更新...
    2007-07-07
  • 小程序?qū)崿F(xiàn)人臉識(shí)別功能(百度ai)

    小程序?qū)崿F(xiàn)人臉識(shí)別功能(百度ai)

    這篇文章主要介紹了小程序?qū)崿F(xiàn)人臉識(shí)別功能(百度ai),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2018-12-12
  • JS彈性運(yùn)動(dòng)實(shí)現(xiàn)方法分析

    JS彈性運(yùn)動(dòng)實(shí)現(xiàn)方法分析

    這篇文章主要介紹了JS彈性運(yùn)動(dòng)實(shí)現(xiàn)方法,結(jié)合實(shí)例形式分析了JS實(shí)現(xiàn)彈性運(yùn)動(dòng)的原理、相關(guān)技術(shù)細(xì)節(jié)與實(shí)現(xiàn)技巧,需要的朋友可以參考下
    2016-12-12
  • js實(shí)現(xiàn)表單項(xiàng)的全選、反選及刪除操作示例

    js實(shí)現(xiàn)表單項(xiàng)的全選、反選及刪除操作示例

    這篇文章主要介紹了js實(shí)現(xiàn)表單項(xiàng)的全選、反選及刪除操作,結(jié)合實(shí)例形式分析了基于dedecms后臺(tái)使用js實(shí)現(xiàn)表單項(xiàng)的全選、反選及刪除相關(guān)操作技巧,需要的朋友可以參考下
    2020-06-06
  • java必學(xué)必會(huì)之static關(guān)鍵字

    java必學(xué)必會(huì)之static關(guān)鍵字

    java必學(xué)必會(huì)之static關(guān)鍵字,static關(guān)鍵字是很多朋友在編寫代碼和閱讀代碼時(shí)碰到的比較難以理解的一個(gè)關(guān)鍵字,下面結(jié)合大家一起學(xué)習(xí)static關(guān)鍵字
    2015-12-12
  • javaScript 刪除確認(rèn)實(shí)現(xiàn)方法小結(jié)

    javaScript 刪除確認(rèn)實(shí)現(xiàn)方法小結(jié)

    因?yàn)閷?duì)于內(nèi)容的刪除是件很重要的事,所以一般的系統(tǒng)中,都需要?jiǎng)h除確認(rèn)一下,以免誤刪,具體的方法如下,大家可以參考下。
    2009-12-12

最新評(píng)論

新巴尔虎左旗| 通许县| 巴马| 手机| 鸡西市| 修文县| 仲巴县| 麻栗坡县| 沁源县| 武鸣县| 黄平县| 靖远县| 永昌县| 新河县| 昭苏县| 富顺县| 连州市| 高唐县| 无极县| 股票| 会泽县| 长顺县| 敦化市| 金昌市| 长泰县| 万全县| 明光市| 三原县| 北川| 周口市| 沧源| 岱山县| 乌鲁木齐县| 石林| 通州市| 焦作市| 临湘市| 大新县| 云龙县| 庄河市| 上虞市|