<SCRIPT type=text/javascript>
<!--
function checkit(){ var locnums=0;
for (var x=0;x<document.form1.categoryId.length;x++){
document.form1.categoryId.options[x].selected = true;
locnums += 1;
}
for(var i=0;i<document.form1.accessories.length;i++){
document.form1.accessories.options[i].selected=true;
locnums +=1;
}
}//-->
</script>
<FORM ACTION="../addnewsservlet" name="form1" onsubmit="return checkit();" method="post">
<select name="categoryId" size="1" multiple>
<option value="2">wewew</option>
</select>
<input name="next" type="submit" id="next" value=" 保 存 "></FORM>
<SCRIPT type=text/javascript>
<!--
//document.form1.mylocation.options[0] = null;
document.form1.categoryId.options[0] = null;//-->
</SCRIPT>
<!--
function checkit(){ var locnums=0;
for (var x=0;x<document.form1.categoryId.length;x++){
document.form1.categoryId.options[x].selected = true;
locnums += 1;
}
for(var i=0;i<document.form1.accessories.length;i++){
document.form1.accessories.options[i].selected=true;
locnums +=1;
}
}//-->
</script>
<FORM ACTION="../addnewsservlet" name="form1" onsubmit="return checkit();" method="post">
<select name="categoryId" size="1" multiple>
<option value="2">wewew</option>
</select>
<input name="next" type="submit" id="next" value=" 保 存 "></FORM>
<SCRIPT type=text/javascript>
<!--
//document.form1.mylocation.options[0] = null;
document.form1.categoryId.options[0] = null;//-->
</SCRIPT>
<% for(int i=0;i<=2;i++){
asd[i]=request.getParameter("categoryId");
out.println(i);
}%>
可以把值去出来吗,谢谢
String nn[]=request.getParameterValues("categoryId");
int L=0;
if(nn!=null){
L=nn.length;
for(int i=0;i<L;i++){
out.println(nn[i]);
}
}