帝国软件
  设为首页 加入收藏 关于我们
 
解密帝国网站管理系统
栏 目:
 
您的位置:首页 > 技术文档 > ASP编程
列表框操作函数集合
作者:佚名 发布时间:2005-04-02 来源:不详
 

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

//描述: 添加不重复列表框元素
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;
}
}

}
}

 
  
评论】【加入收藏夹】【 】【打印】【关闭
※ 相关链接
 ·window.open()的所有参数列表  (2005-04-02)
 ·构建J2EE应用程序的任务列表  (2005-04-02)
 ·ASP环境下邮件列表功能的实现 (  (2005-03-12)
 ·ASP环境下邮件列表功能的实现 (  (2005-03-12)
 ·ASP环境下邮件列表功能的实现 (  (2005-03-12)
 ·ASP环境下邮件列表功能的实现 (  (2005-03-12)
 ·asp实现在web中显示电子表格数据  (2005-03-12)
 ·asp实现在web中显示电子表格数据  (2005-03-12)
 ·用ASP创建多栏选项列表  (2005-03-12)
 ·用ASP/ADSI显示NT系统中的用户和  (2005-03-12)

   栏目导行
  PHP编程
  ASP编程
  ASP.NET编程
  JAVA编程
   站点最新
·致合作伙伴的欢迎信
·媒体报道
·帝国软件合作伙伴计划协议
·DiscuzX2.5会员整合通行证发布
·帝国CMS 7.0版本功能建议收集
·帝国网站管理系统2012年授权购买说
·PHPWind8.7会员整合通行证发布
·[官方插件]帝国CMS-访问统计插件
·[官方插件]帝国CMS-sitemap插件
·[官方插件]帝国CMS内容页评论AJAX分
   类别最新
·在ASP中使用数据库
·使用ASP脚本技术
·通过启动脚本来感受ASP的力量
·学习使用ASP对象和组件
·解析asp的脚本语言
·初看ASP-针对初学者
·ASP开发10条经验总结
·ASP之对象总结
·ASP与数据库应用(给初学者)
·关于学习ASP和编程的28个观点
 
关于帝国 | 广告服务 | 联系我们 | 程序开发 | 网站地图 | 留言板 帝国网站管理系统