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()에서 데이터를 가공해서 보낸다는게 되것다~
'개인적인 프로그램 > 자바스크립트' 카테고리의 다른 글
ajax 와 xml 그리고 ie, ff (0) | 2011.10.26 |
---|---|
ajax와 response.setContentType("text/xml;charset=utf-8") (0) | 2011.10.26 |
폼 리사이즈 스크립트 (0) | 2011.10.26 |
네이버 블로그에 사용돼는 태그 관련 스크립트 (0) | 2011.10.26 |
현재 내가 쓰려는 웹에디터.. (0) | 2011.10.26 |