我要做一个用户权限分配的页面,左边textarea放置很多功能项,然后通过选择,可以把功能项加入右边的textarea.超级简单,求代码,谢谢了。
解决方案 »
- 怎么监听一个定时器有没有挂掉
- 如何用JS控制form里的提交?
- SQL 命令未正确结束!
- struts2与freemarker生成静态页的问题
- 用junit测试的时候出现奇怪的问题
- frameset的问题
- 急招网站工程师,工作地点:美丽的人居奖、旅游城市扬州
- 学习中的一小问题,高手请停留几分钟
- 救命啊。帮我看看,问题出在哪里。我都弄了一天了,就是不知道问题出在哪里?
- jsp中日期的处理问题,急急急!100分奉送。
- Applet与Servlet通信问题
- <a href="http://localhost:8080/114/city.jsp?cityid=<%=city.get(i)%>"><%=city.get(i) %></a>
<html>
<head>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<script language="javascript">
function fun_select_addany(theform){
var i;
for (i=0;i<theform.left_select.length;i++){
if (theform.left_select.options[i].selected == true){
if (theform.left_select.options[i].text !=""){
theform.right_select.options[theform.right_select.length]=new Option(theform.left_select.options[i].text);
theform.left_select.options[i] =new Option("");
}
}
}
for (i=0;i<theform.left_select.length;i++){
if (theform.left_select.options[i].text ==""){theform.left_select.options.remove(i); i--;}
}
}function fun_select_addall(theform){
var i;
for (i=0;i<theform.left_select.length;i++){
if (theform.left_select.options[i].text !=""){
theform.right_select.options[theform.right_select.length]=new Option(theform.left_select.options[i].text);
}
}
theform.left_select.length=0;
} function fun_select_dltany(theform){
var i;
for (i=0;i<theform.right_select.length;i++){
if (theform.right_select.options[i].selected == true){
if (theform.right_select.options[i].text !=""){
theform.left_select.options[theform.left_select.length]=new Option(theform.right_select.options[i].text);
theform.right_select.options[i] =new Option("");
}
}
}
for (i=0;i<theform.right_select.length;i++){
if (theform.right_select.options[i].text ==""){theform.right_select.options.remove(i);i--;}
}
}function fun_select_dltall(theform){
var i;
for (i=0;i<theform.right_select.length;i++){
if (theform.right_select.options[i].text !=""){
theform.left_select.options[theform.left_select.length]=new Option(theform.right_select.options[i].text);
}
}
theform.right_select.length=0;
}
</script></head>
<body bgColor=skyblue>
<form action="select.htm" method="post" name="myform">
<br><br><br>
<div align="center"><center><left>
<table style="FONT-SIZE: smaller">
<tr><td>
<table>
<tr><td>
<!-- 左边选择列表框 -->
<select name="left_select" style="HEIGHT: 200px; WIDTH: 100px" multiple>
<OPTION VALUE="A">1</OPTION><OPTION VALUE="B">2</OPTION>
<OPTION VALUE="C">3</OPTION><OPTION VALUE="D">4</OPTION>
<OPTION VALUE="E">5</OPTION><OPTION VALUE="F">6</OPTION>
<OPTION VALUE="G">7</OPTION><OPTION VALUE="H">8</OPTION>
</select>
</td></tr>
</table>
</td><td>
<table border="0">
<br><br>
<tr><td>
<!-- 中间按钮信息,根据样式设置箭头信息 -->
<INPUT language="javascript" name="btn_select_addany" onClick="fun_select_addany(document.myform)" style="COLOR: blue; FONT-FAMILY: Webdings; FONT-SIZE: 12pt; FONT-WEIGHT: normal; HEIGHT: 28px; WIDTH: 27px" title="Add any" type=button value="8"></td></tr><tr><td>
<INPUT language="javascript" name="btn_select_addall" onClick="fun_select_addall(document.myform)" style="COLOR: blue; FONT-FAMILY: Webdings; FONT-SIZE: 12pt; FONT-WEIGHT: normal; HEIGHT: 28px; WIDTH: 27px" title="Add all" type=button value=: DESIGNTIMESP="17713"></td></tr><tr><td>
<br><br></td></tr><tr><td>
<INPUT language="javascript" name="btn_select_dltany" onClick="fun_select_dltany(document.myform)" style="COLOR: blue; FONT-FAMILY: Webdings; FONT-SIZE: 12pt; FONT-WEIGHT: normal; HEIGHT: 28px; WIDTH: 27px" title ="delete any" type=button value="7"></td></tr><tr><td>
<INPUT language="javascript" name="btn_select_dltall" onClick="fun_select_dltall(document.myform)" style="COLOR: blue; FONT-FAMILY: Webdings; FONT-SIZE: 12pt; FONT-WEIGHT: normal; HEIGHT: 28px; WIDTH: 27px" title ="delete all" type=button value="9"></td></tr>
<tr><td></td></tr>
<tr><td>
</td></tr>
</table></TD><td>
<table style="FONT-SIZE: smaller">
<tr><td>
<!-- 右边选择列表框 -->
<select name="right_select" style="HEIGHT: 200px; WIDTH: 100px" multiple>
</select>
</td></tr>
</table>
</td></TR></TBODY></TABLE></div>
</form>
</body>
</html>
你就是雷锋,hero.many thanks!