<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/struts-tags" prefix="s" %>
<!doctype html>
<
html
>
<
head
>
<
title
>Site Management Centre</
title
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html;charset=utf-8"
/>
<
script
type
=
"text/javascript"
language
=
"javascript"
>
function moveItem(dest, source)
{
var dest = ( typeof dest == "string" ? document.getElementById(dest): dest );
var source = ( typeof source == "string" ? document.getElementById(source) : source );
if( source.tagName.toLowerCase() != "select" || dest.tagName.toLowerCase() != "select" )
return;
for ( index=source.length - 1; index >= 0; index-- ) {
if ( source[index].selected ) {
dest.length++;
dest[dest.length-1].id = source[index].id;
dest[dest.length-1].value = source[index].value;
dest[dest.length-1].text = source[index].text;
source[index] = null;
}
}
}
</
script
>
</
head
>
<
body
>
<
table
width
=
"20%"
border
=
"1"
cellpadding
=
"0"
cellspacing
=
"0"
align
=
"center"
>
<
tr
>
<
td
width
=
"10%"
>
<
select
size
=
"10"
multiple
=
"multiple"
id
=
"left"
ondblclick
=
"moveItem(right,this)"
style
=
"width:120px; "
>
<
option
value
=
"def7"
>ListItem1</
option
>
<
option
value
=
"abcd6"
>ListItem2</
option
>
</
select
>
</
td
>
<
td
width
=
"3%"
>
<
input
type
=
"button"
value=" >> " name="btnRight" onclick="moveItem(right,left)" />
<
input
type
=
"button"
value
=
" << "
onclick
=
"moveItem(left,right)"
id
=
"btn"
name
=
"btnLeft"
/>
</
td
>
<
td
width
=
"10%"
>
<
select
size
=
"10"
multiple
=
"multiple"
id
=
"right"
ondblclick
=
"moveItem(left,this)"
style
=
"width:120px; "
>
</
select
>
</
td
>
</
tr
>
</
table
>
</
body
>
</
html
>
|
select 左右选择器!!!
最新推荐文章于 2022-01-07 11:07:06 发布