设为首页   加入最爱           最新更新:全方位英文文章资料库
 
资料坊搜索: 标题 全文     
列表框操作函数集合
   首页>>YesizeCOM>>电脑技能坊>>ASP>>正文       
 
广告招租,e-mail:yesize@hotmail.com

广告招租,e-mail:yesize@hotmail.com


/* 列表框互相操作函数集 */

//描述: 添加不重复列表框元素
function selAdd( srcList, dstList )
{
var selectedIndex = new Array();
var count = 0;

for ( i=0; i<srcList.options.length; i++ ){

if ( srcList.options[i].selected ){

selectedIndex[count] = i;
count ++;

}
}

for ( j=0; j<selectedIndex.length; j++ ){

k = selectedIndex[j];

if ( chkDup( srcList.options[k].value, dstList )==false ){
dstList.options.length++;
var len = dstList.options.length-1;
dstList.options[len].value = srcList.options[k].value;
dstList.options[len].text = srcList.options[k].text;
}

}

}

//描述: 删除列表框元素
function selDel( list )
{
var len = list.options.length;
var idx = 0;

while ( idx< len ){

if ( list.options[idx].selected ){
list.options.remove(idx);
len = list.options.length;
}
else{
idx ++;
}
}
}

//描述: 检测列表框元素重复
function chkDup( item, list )
{
for ( i=0; i<list.options.length; i++ ){
//alert( item + " - " + list.options[i].value );
if ( item == list.options[i].value ){
return true;
}
}
return false;
}

//描述: 选择列表框的全部成员
function selSel( list, item )
{
item.value = " ";
for ( i=0; i<list.options.length; i++ ){
list.options[i].selected=true;
item.value += list.options[i].value + " ";
}

}

function selSelSingle( list, value )
{
for ( i=0; i<list.options.length; i++ ){
if ( list.options[i].value == value ){
list.options[i].selected=true;
break;
}
}

}
//描述: 根据数组初始化列表框
function selList( item, arr )
{

var curIndex, insIndex, val, text;
var arrItem = new Array();

if ( item ){

item.length = 0;
curIndex = 0;

for ( i=0; i<arr.length; i++ ){

item.length ++;
insIndex = item.length - 1;

if ( arr[i] ){
arrItem = arr[i].split( ", " );
text = arrItem[1];
val = arrItem[0];
item.options[ insIndex ].text = text;
item.options[ insIndex ].value= val;
}
}

}
}


上一篇:层不能跨框架(包括TEXTAREA)显示的解决办法 下一篇:利用cookie收藏网站

版权说明:作品来源于网上,版权归作者所有,如果无意中侵犯了您的版权,请来信告知,本站将在3个工作日内删除。yesize@hotmail.com
  热门小游戏分类 
射击小游戏 连连看小游戏
台球小游戏 成人小游戏
CS小游戏 化妆小游戏
赛车小游戏 休闲小游戏
篮球小游戏 换装小游戏
儿童小游戏 牛牛小游戏
麻将小游戏 冒险小游戏
美媚小游戏 益智小游戏
体育小游戏  
Society Recreation & Sports
Travel & Leisure Communications
Vehicles Computers
Fashion Arts & Entertainment
Reference & Education Disease & Illness
Writing & Speaking Politics
Product Reviews Food & Beverage
Finance Internet Business
Self Improvement Home & Family
Health & Fitness Business
最新更新内容
警惕“公务员报考热”背
公务员考试不是丈母娘考
一名新公务员的自白:我
公务员考脑筋急转弯与挂
北努斗:2006行政能力测
大讨论:06行测BT题目大
过来人回忆:当年,我也
一家之言:公务员热折射
公务员考试申论要是有正
数十万大学生走进公务员
      粤ICP备05005424         Copyright ©2000 - 2004 Yesize.COM