<
html
>
< head >
< script language = " javascript " >
function droplist_submit()
{
var select_instance = document.form1.s1;
var select_instance2 = document.form1.s2;
var option_length = select_instance.options.length;
for (i = 0 ; i < option_length; i ++ )
{
if (select_instance.options[i].selected) {
var oOption = document.createElement( " OPTION " );
oOption.text = select_instance.options[i].text;
oOption.value = select_instance.options[i].value;
select_instance2.appendChild(oOption);
}
}
// print new select options to validate the result
for (i = 0 ; i < select_instance2.options.length; i ++ )
{
alert(select_instance2.options[i].text);
alert(select_instance2.options[i].value);
}
}
< / script>
< / head>
< body >
< form name = form1 method = post action = " javascript: droplist_submit(); " >
< select size = 5 name = s1 multiple >
< option value = " Aoption " > A < / option>
< option value = " Boption " > B < / option>
< option value = " Coption " > C < / option>
< option value = " Doption " > D < / option>
< / select>
< p >< / p>
< select size = 5 name = s2 DISABLED >
< / select>
< p >< input type = submit >< / p>
< / form>
< / body>
< / html>
< head >
< script language = " javascript " >
function droplist_submit()
{
var select_instance = document.form1.s1;
var select_instance2 = document.form1.s2;
var option_length = select_instance.options.length;
for (i = 0 ; i < option_length; i ++ )
{
if (select_instance.options[i].selected) {
var oOption = document.createElement( " OPTION " );
oOption.text = select_instance.options[i].text;
oOption.value = select_instance.options[i].value;
select_instance2.appendChild(oOption);
}
}
// print new select options to validate the result
for (i = 0 ; i < select_instance2.options.length; i ++ )
{
alert(select_instance2.options[i].text);
alert(select_instance2.options[i].value);
}
}
< / script>
< / head>
< body >
< form name = form1 method = post action = " javascript: droplist_submit(); " >
< select size = 5 name = s1 multiple >
< option value = " Aoption " > A < / option>
< option value = " Boption " > B < / option>
< option value = " Coption " > C < / option>
< option value = " Doption " > D < / option>
< / select>
< p >< / p>
< select size = 5 name = s2 DISABLED >
< / select>
< p >< input type = submit >< / p>
< / form>
< / body>
< / html>