问一个下拉框中选值的操作有关问题~能实现马上给分

问一个下拉框中选值的操作问题~能实现马上给分~例子ABC三个下拉框其中我已经把A和B通过2维数组实现2级联动

问一个下拉框中选值的操作问题~能实现马上给分~
例子

ABC三个下拉框

其中我已经把A和B通过2维数组实现2级联动.B是多选下拉框

现在的问题是我要把B中的值   添加到C里面,   B和C之间设计了添加和删除两个按钮

C的值可以通过着两个按钮实现添加和删除,C框里的值不能重复

就像B框中的一个选择 <OPTION     value= "1000元 "> 1000元 </OPTION>
到C框中还是 <OPTION     value= "1000元 "> 1000元 </OPTION>


请教JS牛人~

[解决办法]
参考:
<html>
<head>
<title> 添加与删除Option对象 </title>
<script_ language= "Javascript_ ">
// 添加选项
function addOption(pos){
var objSelect = document.myForm.mySelect;
// 取得字段值
var strName = document.myForm.myOptionName.value;
var strValue = document.myForm.myOptionValue.value;
// 建立Option对象
var objOption = new Option(strName,strValue);
if (pos == -1 & pos > objSelect.options.length)
objSelect.options[objSelect.options.length] = objOption;
else
objSelect.add(objOption, pos);
}
// 删除选项
function deleteOption(type){
var objSelect = document.myForm.mySelect;
if (type == true)
objSelect.options[objSelect.selectedIndex] = null;
else
objSelect.remove(objSelect.selectedIndex);
}
// 显示选项信息
function showOption(objForm){
var objSelect = objForm.mySelect;
var name = objSelect.options[objSelect.selectedIndex].text;
var value = objSelect.options[objSelect.selectedIndex].value;
alert(name + " = " + value);
}
</script_>
</head>
<body>
<h2> 添加与删除Option对象 </h2>
<hr>
<form name= "myForm ">
<select name= "mySelect ">
<option value= "中国 " Selected> 中国 </option>
<option value= "日本 "> 日本 </option>
<option value= "美国 "> 美国 </option>
</select>
<input type= "button " onclick= "showOption(this.form) " value= "显示 ">
<input type= "button " onclick= "deleteOption(true) " value= "删除 ">
<input type= "button " onclick= "deleteOption(false) " value= "Remove方法 "> <br> <br>
选项名称 : <input type= "text " name= "myOptionName " value= "英国 "> <br>
选项的值 : <input type= "text " name= "myOptionValue " value= "value4 ">
<input type= "button " onclick= "addOption(-1) " value= "添加 ">
<input type= "button " onclick= "addOption(0) " value= "插入 ">
</form>
</body>
</html>


[解决办法]
帮你调试了一下,注意form标签的包含位置就行了。
----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml ">


<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 " />
<title> 无标题文档 </title>
</head>
<SCRIPT LANGUAGE= "JavaScript ">
<!--
function objClone(obj)
//obj为要克隆的对象,不需要构造方法
{
result = new Option();
result.value=obj.value;
result.text=obj.text;
return result ;
}
//-->
</SCRIPT>

<script language= "javascript ">
function add(){
var selectfrom=document.getElementById( 'selectfrom ');
var select2=document.getElementById( 'select2 ');
var opt=selectfrom.options;
var i=0;
while(i <opt.length)
{
if(opt[i].selected){
select2.appendChild(opt[i]);
}
else{
i++;
}
}
}

function addAll(){
var selectfrom=document.getElementById( 'selectfrom ');
var select2=document.getElementById( 'select2 ');
var opt=selectfrom.options;
var i=0;
while(i <opt.length)
{
select2.appendChild(opt[i]);
}
}

function del(){
var selectfrom=document.getElementById( 'selectfrom ');
var select2=document.getElementById( 'select2 ');
var opt=select2.options;
len=opt.length;
for(i=len-1;i> -1;i--){
if(opt[i].selected){
selectfrom.appendChild(opt[i]);
}
}
}

function delAll(){
var selectfrom=document.getElementById( 'selectfrom ');
var select2=document.getElementById( 'select2 ');
var opt=select2.options;
len=opt.length;
for(i=len-1;i> -1;i--){
selectfrom.appendChild(opt[i]);
}
}

var selects=[];
selects[ 'xxx ']=new Array(new Option( '请选择城市 ', 'xxx '));
selects[ '10 ']=new Array(
new Option( '南宁市 ', '1 '),
new Option( '防城港市 ', '2 '),
new Option( '贵港市 ', '14 '));


selects[ '9 ']=new Array(
new Option( '兰州市 ', '1 '),
new Option( '白银市 ', '14 '));

function select_change(){
var selectfrom=document.getElementById( 'selectfrom ');
var select_province=document.getElementById( 'select_province ');
selectfrom.length=0;
var opts=selects[select_province.value];
for(i=0;i <opts.length;i++){
var temp=objClone(opts[i]);
selectfrom.add(temp);
}
}
</script>
<body>

<p>
<select id= "select_province " onchange= "select_change() ">
<option value= "xxx " selected> 请选择省份…… </option>
<option value= "9 "> G-甘肃 </option>
<option value= "10 "> G-广西 </option>
</select>
</p>
<table width= "27% " height= "194 " border= "0 " cellpadding= "1 " cellspacing= "0 ">
<tr valign= "absmiddle ">
<td width= "21% "> <select id= "selectfrom " size= "15 " multiple= "multiple " style= "width:100px "> </select> </td>
<td width= "57% " valign= "middle "> <p align= "center ">
<input name= "addAll " type= "button " id= "addAll " value= " &gt;&gt; " style= "width:40px " onclick= "addAll() "/>
</p>


<p align= "center ">
<input name= "add " type= "button " id= "add " style= "width:40px " value= " &gt; " onclick= "add() "/>
</p>
<p align= "center ">
<input name= "del " type= "button " id= "del " value= " &lt; " style= "width:40px " onclick= "del() "/>
</p>
<p align= "center ">
<input name= "delAll " type= "button " id= "delAll " value= " &lt;&lt; " style= "width:40px " onclick= "delAll() "/>
</p> </td>
<td width= "22% "> <form name= "from1 ">
<select id= "select2 " size= "15 " multiple= "multiple " style= "width:100px "> </select>
</form> </td>
</tr>
</table>

</body>
</html>