function selectSort(sortMethod) {
 formSel = document.categoryForm.CatItem;

 if(!formSel.value) return;

 thisIndex = formSel.selectedIndex;

 if(sortMethod == "down") { //다운일때
  if(thisIndex+1 >= formSel.length) return;
  formSel.value = null;
  prevIndex = thisIndex + 1;
 }
 else { //업일때
  if(!thisIndex) return; 
  formSel.value = null;
  prevIndex = thisIndex-1;
 }

 tempText = formSel.options[prevIndex].text;
 tempValue = formSel.options[prevIndex].value;

 formSel.options[prevIndex] = new Option(formSel.options[thisIndex].text,formSel.options[thisIndex].value);

 formSel.options[thisIndex] = new Option(tempText,tempValue);

 formSel.value = formSel.options[prevIndex].value; 
}

function updateSort() {
 var oForm = document.categoryForm;

 formSel = document.categoryForm.CatItem;

 res = new Array();

    for(var i=0;i<formSel.length;i++) {
  arrayValue = formSel.options[i].value.split("||");

     res[i] = arrayValue[0];
    }

 res = res.join("@");
 oForm.sortItem.value = res;

 if (confirm('카테고리 출력순서를 재정렬 하시겠습니까?')) {
  oForm.runMode.value = "sort";  
  oForm.action="inCateFrame1.asp";
  oForm.submit();
 }
 else {
  return;
 }
}

 

 

대략이런식 키포인트는 updateSort()에서 데이터를 가공해서 보낸다는게 되것다~

 

Posted by 삽지리
,