php页面中,现要实现 左边一个框,框中有很多记录,要移到右边的框,并移完后,右边是要用的记录,
这一功能如何实现  thanks

解决方案 »

  1.   

    是不是下面的功能??????<select id="select1" size="20">
    <option>可以选择的水果</option>
    <option>--------------</option>
    <option value="大香蕉">香蕉</option>
    <option value="大苹果">苹果</option>
    <option value="大橘子">橘子</option>
    <option value="大火龙果">火龙果</option>
    </select><input type="button" value=" >> " onclick="add()">
    <input type="button" value=" << " onclick="del()"><select id="select2" size="20">
    <option>可以选择的水果</option>
    <option>--------------</option>
    </select><script language="javascript">
    function add(){
    var select1 = document.getElementById("select1");
    var select2 = document.getElementById("select2");
    var select_index = select1.selectedIndex; if(select_index > 1){
    var option = document.createElement("option"); //第一种
    // option.value = select1.options[select_index].value;
    // option.innerHTML = select1.options[select_index].innerHTML;
    // select2.appendChild(option); select2.options.add(new Option(select1.options[select_index].innerHTML, select1.options[select_index].value));//第二种 select1.options[select_index] = null;
    }
    }function del(){
    var select1 = document.getElementById("select1");
    var select2 = document.getElementById("select2");
    var select_index = select2.selectedIndex;

    if(select_index > 1){
    var option = document.createElement("option"); //第一种
    // option.value = select2.options[select_index].value;
    // option.innerHTML = select2.options[select_index].innerHTML;
    // select1.appendChild(option); select1.options.add(new Option(select2.options[select_index].innerHTML, select2.options[select_index].value));//第二种 select2.options[select_index] = null;
    }
    }
    </script>
      

  2.   

    <script src="JS/jquery-1.3.2.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
        $("#Button1").click(function() {
                $selceted = $("#se1 option:selected");
                $selceted.appendTo("#se2");        })    })
        $(function() {
            $("#Button2").click(function() {
                $selceted = $("#se2 option:selected");
                $selceted.appendTo("#se1");        })    })
        $(function() {
        $("#Button3").click(function() {
        $select = $("#se1 option").attr();
            $select.appendTo("#se2")      
        })
    })
    $(function() {
        $("#Button4").click(function() {
            $select = $("#se2 option").attr();
            $select.appendTo("#se1")
        })
    })</script>JQERY的插件导入一下,四个按钮 第一个→移 2是←移  三是全部移动到→ 四全部移动到←边
     我才写过的。你试试  
      

  3.   

    <select id="select1" size="20">
    <option>可以选择的水果</option>
    <option>--------------</option>
    <option value="大香蕉">香蕉</option>
    <option value="大苹果">苹果</option>
    <option value="大橘子">橘子</option>
    <option value="大火龙果">火龙果</option>
    </select><input type="button" value=" >> " onclick="add()">
    <input type="button" value=" << " onclick="del()"><select id="select2" size="20">
    <option>可以选择的水果</option>
    <option>--------------</option>
    </select><script language="javascript">
    var arr = new Array();
    function add(){
    var select1 = document.getElementById("select1");
    var select2 = document.getElementById("select2");
    var select_index = select1.selectedIndex;if(select_index > 1){
    var option = document.createElement("option");//第一种
    // option.value = select1.options[select_index].value;
    // option.innerHTML = select1.options[select_index].innerHTML;
    // select2.appendChild(option);select2.options.add(new Option(select1.options[select_index].innerHTML, select1.options[select_index].value));//第二种
    arr[arr.length] = select1.options[select_index].value;alert(arr);
    select1.options[select_index] = null;
    }
    }function del(){
    var select1 = document.getElementById("select1");
    var select2 = document.getElementById("select2");
    var select_index = select2.selectedIndex;if(select_index > 1){
    var option = document.createElement("option");//第一种
    // option.value = select2.options[select_index].value;
    // option.innerHTML = select2.options[select_index].innerHTML;
    // select1.appendChild(option);select1.options.add(new Option(select2.options[select_index].innerHTML, select2.options[select_index].value));//第二种
    arr.length = [arr.length - 1];
    alert(arr);
    select2.options[select_index] = null;
    }
    }
    </script>
      

  4.   

    不是已经得到了么,那个alert()出来的就是一个数组,不是想得到option的value么?
      

  5.   

    我是说,
    从左边移到右边后,
    我再用submit 提交时,怎么得到select2中的值,
      

  6.   

    onsubmit事件触发函数,在函数中组合数组字符串赋值给隐藏域然后提交(表单形式),当然了,ajax也不错
      

  7.   

    我是说,
    从左边移到右边后,
    我再用submit 提交时,怎么得到select2中的值,