From 8fad508b0fd37b7bd7d7eba68bc33ab09d4cfc78 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Wed, 28 Jul 2010 06:11:59 +0000 Subject: [PATCH] + add functions to operate select. --- trunk/www/js/my.js | 99 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 98 insertions(+), 1 deletion(-) diff --git a/trunk/www/js/my.js b/trunk/www/js/my.js index 9da4cd2e96..d0fe2d804d 100644 --- a/trunk/www/js/my.js +++ b/trunk/www/js/my.js @@ -12,7 +12,7 @@ function loadFixedCSS() } if(cssFile != '') { - document.write(""); + document.write(""); } /* 解决safari和chrome的caption问题。*/ @@ -213,6 +213,103 @@ function setHelpLink() ); } +/* add one option of a select to another select. */ +function addItem(SelectID,TargetID) +{ + ItemList = document.getElementById(SelectID); + Target = document.getElementById(TargetID); + for(var x = 0; x < ItemList.length; x++) + { + var opt = ItemList.options[x]; + if (opt.selected) + { + flag = true; + for (var y=0;y=0;x--) + { + var opt = ItemList.options[x]; + if (opt.selected) + { + ItemList.options[x] = null; + } + } +} + +/* move one selected option up from a select. */ +function upItem(SelectID) +{ + ItemList = document.getElementById(SelectID); + for(var x=1;x=0;x--) + { + var opt = ItemList.options[x]; + opt.selected = true; + } +} + + /* 需要不需要ping,已保证session不过期。 */ needPing = true;