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

ASP
ADO如何提供异动功能?(BIG5)
从数据库中动态选取下拉列表的方法
数 据 库 设 计 经 验 谈
用SQL实现分布式数据复制
NT4的ODBC与SQL7相连,不支持中文?
大部分ADO的错误码对应的含义
ASP+中取代ASP的RS(Remote Scripting)技术的Framework
利用Page.IsPostBack属性保持用户输入的Framework
用VB6读写数据库中的图片
VisualInterDev6.0七种实现分页显示的方法
利用ASP获得图象的实际尺寸的示例
5个实用的ASP网站功能(GIB5)
在ASP中用集合成批操作数据库
用asp管理sql server数据库
用asp处理access数据库
使用速度更快的OLEDB取代ODBC连结
对Query字段进行Encode操作的一点看法
用ASP语言实现对SQL SERVER 数据库的操作
Microsoft SQL Server 7.0 备份及恢复相关问题
Microsoft SQL Server 7.0数据库升级转换问题

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 34 ::
收藏到网摘: 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