1 得到Request.getParameter("selectname")。然后截取字符串,以","作为分隔符。变可得到选择的各个值
解决方案 »
- struts的问题,高手请教!!
- struts2中,如何让标签不显示历史记录
- 关于数据库承受的压力??
- tomcat出了个怪问题???(急!!!!!)
- 哪位高手能帮帮我?~~ 关于 另存为 Web页,全部(*.htm;*.html) 的问题
- 很急,哪位用stylereport做过报表,请指教
- 在weblogic里设置了连接池,怎么在JSP里面调用?
- 如何在jsp的标签处理程序类中正确调用PageContext的getOut方法?马上给分哈
- apache日志管理!急!急!急!
- JSP的Tag问题,在线等
- jsp,asp,php通用的解决方法???
- 应该怎样在jsp中显示中文,平台是jswdk1.0.1
//选择全部
var k=0;function btnForward_onclick(){
var theIndex=window.form1.selSubmit.selectedIndex;;
var FirIndex=theIndex-1;
var lenghtSel=window.form1.selSubmit.length;
if(lenghtSel!=0){
if(theIndex<0){
alert("请您先选择一个要移动的栏目...");
}else{
if(theIndex==0){
alert("已经是最前面了...")
}else{
var valF=window.form1.all("selSubmit")(FirIndex).value; //前一个option的值
var valT=window.form1.all("selSubmit")(theIndex).value; //当前option的值
var innerTextF=window.form1.all("selSubmit")(FirIndex).innerText; //前一个option的显示内容
var innerTextT=window.form1.all("selSubmit")(theIndex).innerText; //当前option的显示内容
window.form1.all("selSubmit")(theIndex).innerText=innerTextF; //改变显示顺序
window.form1.all("selSubmit")(FirIndex).innerText=innerTextT; window.form1.all("selSubmit")(theIndex).value=valF; //改变select的值
window.form1.all("selSubmit")(FirIndex).value=valT; window.form1.selSubmit.selectedIndex=FirIndex
}
}
}else{
alert("没有可前移的视图项目,请新增一个...");
}
}
function btnBackward_onclick(){ var theIndex=window.form1.selSubmit.selectedIndex;
var maxIndex=document.all("selSubmit").length-1;
var lenghtSel=window.form1.selSubmit.length;
var LstIndex=theIndex+1;
if(lenghtSel!=0){
if(theIndex<0){
alert("请您先选择一个要移动的栏目...");
}else{
if(theIndex==maxIndex){
alert("已经是最后面了...")
}else{
var valL=window.form1.all("selSubmit")(LstIndex).value; //后一个option的值
var valT=window.form1.all("selSubmit")(theIndex).value; //当前option的值
var innerTextL=window.form1.all("selSubmit")(LstIndex).innerText; //后一个option的显示内容
var innerTextT=window.form1.all("selSubmit")(theIndex).innerText; //当前option的显示内容
window.form1.all("selSubmit")(LstIndex).innerText=innerTextT; //改变显示顺序
window.form1.all("selSubmit")(theIndex).innerText=innerTextL;
window.form1.all("selSubmit")(LstIndex).value=valT; //改变select的值
window.form1.all("selSubmit")(theIndex).value=valL;
window.form1.selSubmit.selectedIndex=LstIndex
}
}
}else{
alert("没有可后移的视图项目,请新增一个...");
}
}
//选择全部
function addAll(srcSel,objSel) {
var inti
var length1=eval("window.form1."+srcSel+".length")-1;
var tempString
var tempValue
for(inti=0;inti<=length1;inti++){
window.form1.all(srcSel)(inti).selected=true;
var objOpt=document.createElement("option");
tempString=window.form1.all(srcSel)(inti).innerText;
tempValue=window.form1.all(srcSel)(inti).value; objOpt.text=tempString;
objOpt.value=tempValue;
eval("form1."+objSel+".add(objOpt)");
}
for(inti=0;inti<=length1;inti++){ eval("form1."+srcSel+".remove(objOpt)");
}
}//删除全部
function delAll(srcSel,objSel) {
var inti
var length1=eval("window.form1."+objSel+".length")-1;
var tempString
var tempValue
for(inti=0;inti<=length1;inti++){
window.form1.all(objSel)(inti).selected=true;
var objOpt=document.createElement("option"); tempString=window.form1.all(objSel)(inti).innerText;
tempValue=window.form1.all(objSel)(inti).value;
if(objSel!="selSubmit")
{
removeSign(tempString,tempValue); //调用vb子程序进行字符处理
tempString=form1.hid_String1.value; //重新赋值
tempValue=form1.hid_String2.value;
}
objOpt.text=tempString;
objOpt.value=tempValue; eval("form1."+srcSel+".add(objOpt)");
}
for(inti=0;inti<=length1;inti++){
eval("form1."+objSel+".remove(objOpt)");
}
k=0;
}//删除一条记录
function delOne(srcSel,objSel){ var inti
var length1=eval("window.form1."+objSel+".length")-1;
var tempString
var tempValue
inti=eval("window.form1."+objSel+".selectedIndex");
if(length1>=0){
if(inti>=0){ var objOpt=document.createElement("option"); tempString=window.form1.all(objSel)(inti).innerText;
tempValue=window.form1.all(objSel)(inti).value;
if(objSel!="selSubmit")
{
removeSign(tempString,tempValue); //调用vb子程序进行字符处理
tempString=form1.hid_String1.value; //重新赋值
tempValue=form1.hid_String2.value;
}
objOpt.text=tempString;
objOpt.value=tempValue; eval("form1."+srcSel+".add(objOpt)");
eval("form1."+objSel+".remove(inti)");
if(k==5){
k=k-2;
}else{
k=k-1;
}
}else{
alert("请您先选择要移除的栏目...")
}
}else{
alert("没有可移除的栏目...");
}
}//新增一条记录function addOne(srcSel,objSel) { var inti
var length1=eval("window.form1."+srcSel+".length")-1;
var tempString
var tempValue
inti=eval("window.form1."+srcSel+".selectedIndex");
if(length1>=0){
if(inti>=0){
var objOpt=document.createElement("option"); tempString=window.form1.all(srcSel)(inti).innerText;
tempValue=window.form1.all(srcSel)(inti).value;
objOpt.text=tempString;
objOpt.value=tempValue;
eval("form1."+objSel+".add(objOpt)"); //新增一个option
eval("form1."+srcSel+".remove(inti)"); //移除原有的option
}else{
alert("请您先选择要增加的栏目...");
}
}else{
alert("没有可增加的栏目...");
}
}
String s[] = request.getParameterValues("selectname")
2、楼上的就可以了。