当前位置: 首页 > 图文教程 > 网络编程 > ASP > 列表项可上下移动的Multiple列表

ASP
remote script文档(转载自微软)(八)
不能ASP图像组件来生成图像的ASP计数器程序(二)
不能ASP图像组件来生成图像的ASP计数器程序(三)
用ASP发送邮件
用ASP进行网络打印功能
用ASP实现号码转换
如何用ASP创建日志文件
二十八条改善 ASP 性能和外观的技巧(1-7)
二十八条改善 ASP 性能和外观的技巧(8-14)
二十八条改善 ASP 性能和外观的技巧(15-21)
二十八条改善 ASP 性能和外观的技巧(22-28)
asp实现在web中显示电子表格数据(一)显示数据表格的应用
asp实现在web中显示电子表格数据(二)生成HTML表格
asp实现在web中显示电子表格数据(三)创建数据表列表和名字范围
asp实现在web中显示电子表格数据(四)创建文件选择列表
Carello Web 使 ASP 源码暴露 (APP,缺陷)
MS IIS虚拟主机ASP源码泄露 (MS,缺陷)
虚拟web目录容易泄露ASP源代码 (MS,缺陷)
MS IIS server的ASP安全缺陷 (MS,缺陷)
用WinSock设计Chat程序(转)

ASP 中的 列表项可上下移动的Multiple列表


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 33 ::
收藏到网摘: n/a

  <HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<STYLE>
BODY, SELECT
{
    FONT-FAMILY: TIMES NEW ROMAN;
    FONT-SIZE: 10PT;
}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.onload = initPage;
function initPage()
{
    btnPutUp.onclick    = putUp;
    btnPutDown.onclick    = putDown;

    btnGoUp.onclick    = goUp;
    btnGoDown.onclick    = goDown;
}

function putUp()
{
    var strTempValue;
    var strTempText;
    var intCurIndex;
    
    intCurIndex = sltFruit.selectedIndex;
    //alert("intCurIndex: " + intCurIndex);

    if (intCurIndex > 0)
    {
        strTempValue= sltFruit.options.item(intCurIndex).value;
        strTempText    = sltFruit.options.item(intCurIndex).text;
        //alert(strTempText + " - " + strTempValue);
        
        sltFruit.options.item(intCurIndex).value    = sltFruit.options.item(intCurIndex - 1).value;
        sltFruit.options.item(intCurIndex).text        = sltFruit.options.item(intCurIndex - 1).text;
        sltFruit.options.item(intCurIndex - 1).value= strTempValue;
        sltFruit.options.item(intCurIndex - 1).text    = strTempText;
        sltFruit.selectedIndex = intCurIndex - 1;
    }
}

function putDown()
{
    var strTempValue;
    var strTempText;
    var intCurIndex;
    var intIndexCount;
    
    intCurIndex    = sltFruit.selectedIndex;
    intIndexCount    = sltFruit.length;
    //alert("intCurIndex: " + intCurIndex);
    //alert("intIndexCount: " + intIndexCount);
    
    if (intCurIndex < intIndexCount - 1)
    {
        strTempValue= sltFruit.options.item(intCurIndex).value;
        strTempText    = sltFruit.options.item(intCurIndex).text;
        //alert(strTempText + " - " + strTempValue);
        
        sltFruit.options.item(intCurIndex).value    = sltFruit.options.item(intCurIndex + 1).value;
        sltFruit.options.item(intCurIndex).text        = sltFruit.options.item(intCurIndex + 1).text;
        sltFruit.options.item(intCurIndex + 1).value= strTempValue;
        sltFruit.options.item(intCurInd