½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
happycgi
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > JAVASCRIPT > javascript ¼Ò½ºÃ¢°í > Æû °ü·Ã > ¼¿·ºÆ® ¸Þ´º¸ñ·ÏÀ» ´Ù¸¥ ¼¿·ºÆ®·Î À̵¿ »ó¼¼Á¤º¸
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
css
html
mysql
jquery
image
API
Mobile
¸Þ´º
slide
°Ô½ÃÆÇ
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
¼¿·ºÆ® ¸Þ´º¸ñ·ÏÀ» ´Ù¸¥ ¼¿·ºÆ®·Î À̵¿
¼Ò½ºÅë°èÁ¤º¸ ¿À·ù½Å°í ¹× ¹®ÀÇ
ÇØÇÇÆÀ
³×ƼÁð
Æ®À§ÅÍ·Î º¸³»±â ÆäÀ̽ººÏÀ¸·Î º¸³»±â
¼Ò½ººÐ·ù Æû °ü·Ã
´Ù¿î·Îµå Ƚ¼ö 1019 ȸ
°£´Ü¼³¸í ¼¿·ºÆ®¸Þ´º¿¡ ÀÖ´Â ¸ñ·ÏÀ» ´ÙÁß¼±Åà ¶Ç´Â Àüü¸ñ·ÏÀ» ´Ù¸¥ ¼¿·ºÆ®·Î À̵¿ÇÏ´Â ±â´ÉÀÔ´Ï´Ù.
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
ȨÆäÀÌÁö¹Ù·Î°¡±â ¼Ò½º´Ù¿î·Îµå µ¥¸ð ¹Ì¸®º¸±â ½ºÅ©·¦Çϱâ

<html>
<head>
    <title>ÇØÇÇCGI</title>
<style type="text/css">
.multipleSelectBoxControl span{    /* Labels above select boxes*/
    font-family:arial;
    font-size:11px;
    font-weight:bold;
}
.multipleSelectBoxControl div option{    /* Select box layout */
    font-family:arial;

}

.multipleSelectBoxControl div select{   
   
    height:100%;
}
.multipleSelectBoxControl input{    /* Small butons */
    width:25px;   
}

.multipleSelectBoxControl div{
    float:left;
}
   
</style>
<script type="text/javascript">

/************************************************************************************************************
(C) www.dhtmlgoodies.com, October 2005
************************************************************************************************************/

   
var fromBoxArray = new Array();
var toBoxArray = new Array();
var selectBoxIndex = 0;
var arrayOfItemsToSelect = new Array();


function moveSingleElement()
{
    var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,'');
    var tmpFromBox;
    var tmpToBox;
    if(this.tagName.toLowerCase()=='select'){           
        tmpFromBox = this;
        if(tmpFromBox==fromBoxArray[selectBoxIndex])tmpToBox = toBoxArray[selectBoxIndex]; else tmpToBox = fromBoxArray[selectBoxIndex];
    }else{
   
        if(this.value.indexOf('>')>=0){
            tmpFromBox = fromBoxArray[selectBoxIndex];
            tmpToBox = toBoxArray[selectBoxIndex];           
        }else{
            tmpFromBox = toBoxArray[selectBoxIndex];
            tmpToBox = fromBoxArray[selectBoxIndex];   
        }
    }
   
    for(var no=0;no<tmpFromBox.options.length;no++){
        if(tmpFromBox.options[no].selected){
            tmpFromBox.options[no].selected = false;
            tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value);
           
            for(var no2=no;no2<(tmpFromBox.options.length-1);no2++){
                tmpFromBox.options[no2].value = tmpFromBox.options[no2+1].value;
                tmpFromBox.options[no2].text = tmpFromBox.options[no2+1].text;
                tmpFromBox.options[no2].selected = tmpFromBox.options[no2+1].selected;
            }
            no = no -1;
            tmpFromBox.options.length = tmpFromBox.options.length-1;
                                       
        }           
    }
   
   
    var tmpTextArray = new Array();
    for(var no=0;no<tmpFromBox.options.length;no++){
        tmpTextArray.push(tmpFromBox.options[no].text + '___' + tmpFromBox.options[no].value);           
    }
    tmpTextArray.sort();
    var tmpTextArray2 = new Array();
    for(var no=0;no<tmpToBox.options.length;no++){
        tmpTextArray2.push(tmpToBox.options[no].text + '___' + tmpToBox.options[no].value);           
    }       
    tmpTextArray2.sort();
   
    for(var no=0;no<tmpTextArray.length;no++){
        var items = tmpTextArray[no].split('___');
        tmpFromBox.options[no] = new Option(items[0],items[1]);
       
    }       
   
    for(var no=0;no<tmpTextArray2.length;no++){
        var items = tmpTextArray2[no].split('___');
        tmpToBox.options[no] = new Option(items[0],items[1]);           
    }
}

function sortAllElement(boxRef)
{
    var tmpTextArray2 = new Array();
    for(var no=0;no<boxRef.options.length;no++){
        tmpTextArray2.push(boxRef.options[no].text + '___' + boxRef.options[no].value);           
    }       
    tmpTextArray2.sort();       
    for(var no=0;no<tmpTextArray2.length;no++){
        var items = tmpTextArray2[no].split('___');
        boxRef.options[no] = new Option(items[0],items[1]);           
    }       
   
}
function moveAllElements()
{
    var selectBoxIndex = this.parentNode.parentNode.id.replace(/[^\d]/g,'');
    var tmpFromBox;
    var tmpToBox;       
    if(this.value.indexOf('>')>=0){
        tmpFromBox = fromBoxArray[selectBoxIndex];
        tmpToBox = toBoxArray[selectBoxIndex];           
    }else{
        tmpFromBox = toBoxArray[selectBoxIndex];
        tmpToBox = fromBoxArray[selectBoxIndex];   
    }
   
    for(var no=0;no<tmpFromBox.options.length;no++){
        tmpToBox.options[tmpToBox.options.length] = new Option(tmpFromBox.options[no].text,tmpFromBox.options[no].value);           
    }   
   
    tmpFromBox.options.length=0;
    sortAllElement(tmpToBox);
   
}


/* This function highlights options in the "to-boxes". It is needed if the values should be remembered after submit. Call this function onsubmit for your form */
function multipleSelectOnSubmit()
{
    for(var no=0;no<arrayOfItemsToSelect.length;no++){
        var obj = arrayOfItemsToSelect[no];
        for(var no2=0;no2<obj.options.length;no2++){
            obj.options[no2].selected = true;
        }
    }
   
}

function createMovableOptions(fromBox,toBox,totalWidth,totalHeight,labelLeft,labelRight)
{       
    fromObj = document.getElementById(fromBox);
    toObj = document.getElementById(toBox);
   
    arrayOfItemsToSelect[arrayOfItemsToSelect.length] = toObj;

   
    fromObj.ondblclick = moveSingleElement;
    toObj.ondblclick = moveSingleElement;

   
    fromBoxArray.push(fromObj);
    toBoxArray.push(toObj);
   
    var parentEl = fromObj.parentNode;
   
    var parentDiv = document.createElement('DIV');
    parentDiv.className='multipleSelectBoxControl';
    parentDiv.id = 'selectBoxGroup' + selectBoxIndex;
    parentDiv.style.width = totalWidth + 'px';
    parentDiv.style.height = totalHeight + 'px';
    parentEl.insertBefore(parentDiv,fromObj);
   
   
    var subDiv = document.createElement('DIV');
    subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px';
    fromObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px';

    var label = document.createElement('SPAN');
    label.innerHTML = labelLeft;
    subDiv.appendChild(label);
   
    subDiv.appendChild(fromObj);
    subDiv.className = 'multipleSelectBoxDiv';
    parentDiv.appendChild(subDiv);
   
   
    var buttonDiv = document.createElement('DIV');
    buttonDiv.style.verticalAlign = 'middle';
    buttonDiv.style.paddingTop = (totalHeight/2) - 50 + 'px';
    buttonDiv.style.width = '30px';
    buttonDiv.style.textAlign = 'center';
    parentDiv.appendChild(buttonDiv);
   
    var buttonRight = document.createElement('INPUT');
    buttonRight.type='button';
    buttonRight.value = '>';
    buttonDiv.appendChild(buttonRight);   
    buttonRight.onclick = moveSingleElement;   
   
    var buttonAllRight = document.createElement('INPUT');
    buttonAllRight.type='button';
    buttonAllRight.value = '>>';
    buttonAllRight.onclick = moveAllElements;
    buttonDiv.appendChild(buttonAllRight);       
   
    var buttonLeft = document.createElement('INPUT');
    buttonLeft.style.marginTop='10px';
    buttonLeft.type='button';
    buttonLeft.value = '<';
    buttonLeft.onclick = moveSingleElement;
    buttonDiv.appendChild(buttonLeft);       
   
    var buttonAllLeft = document.createElement('INPUT');
    buttonAllLeft.type='button';
    buttonAllLeft.value = '<<';
    buttonAllLeft.onclick = moveAllElements;
    buttonDiv.appendChild(buttonAllLeft);
   
    var subDiv = document.createElement('DIV');
    subDiv.style.width = (Math.floor(totalWidth/2) - 15) + 'px';
    toObj.style.width = (Math.floor(totalWidth/2) - 15) + 'px';

    var label = document.createElement('SPAN');
    label.innerHTML = labelRight;
    subDiv.appendChild(label);
           
    subDiv.appendChild(toObj);
    parentDiv.appendChild(subDiv);       
   
    toObj.style.height = (totalHeight - label.offsetHeight) + 'px';
    fromObj.style.height = (totalHeight - label.offsetHeight) + 'px';

       
    selectBoxIndex++;
   
}
</script>   
</head>
<body>

<form method="post" action="multiple_select.html" onsubmit="multipleSelectOnSubmit()">
<select multiple name="fromBox[]" id="fromBox">
    <option value="3">Finland</option>
    <option value="4">France</option>
    <option value="6">Mexico</option>
    <option value="1">Norway</option>
    <option value="5">Spain</option>   
    <option value="2">United Kingdom</option>
</select>
<select multiple name="toBox[]" id="toBox">
    <option value="12">Canada</option>
    <option value="13">Germany</option>
    <option value="11">United States</option>
</select>
<input type="submit" value="OK">
</form>

<script type="text/javascript">
createMovableOptions("fromBox","toBox",500,300,'Available countries','Selected countries');
</script>

</body>
</html>


³×ƼÁð ÀÇ°ß   ÀÌ¿ëÇϽŠÀÚ·áÀÇ Èı⸦ ÀÚÀ¯·Ó°Ô ÀÛ¼ºÇϼ¼¿ä. (»ó¾÷ÀûÀÎ ±¤°í ¹× µµ¹è¼º ±Û µîÀº »çÀüÅ뺸¾øÀÌ »èÁ¦µÉ ¼ö ÀÖ½À´Ï´Ù.)
³»¿ë ¾ÆÀ̵ð ÀÇ°ß³²±â±â
µî·ÏµÈ ÀÇ°ßÀÌ ¾ø½À´Ï´Ù.
1
À̸§
³»¿ë
:³×¸Â¾Æ¿ä: :È­³ª´Â±º¿ä: :Àá¿Í: :¿ì¿ïÇØ: :À̰ǾƳÄ: :¿ÕÇÏÇÏ: ¿Õ¿ôÀ½~ ³î·¥~
Æò°¡Çϱâ ÈǸ¢ÇÔ ¸Å¿ìÁÁÀ½ ÁÁÀ½ ±¦ÂúÀ½ º¸Åë º°·Î
µµ¹è¹æÁöÅ°
 89527728 º¸ÀÌ´Â µµ¹è¹æÁöÅ°¸¦ ÀÔ·ÂÇϼ¼¿ä.