jsp数组出问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
function aa()
{
var xingming=document.form1.textfield.value;
var x=document.form1.nv.checked;
if(xingming=="")
{ alert("请输入姓名!"); }
else
{
if(!x)
{
x=document.form1.nan.value+" ";
}
else
{
x=document.form1.nv.value+" ";
}
var aihao="";
var y=document.form1.zhu2;
for(int i=0;i<y.length;i++)
{
if(y[i].checked)
{aihao+=y[i].value+"、";}
}
alert("姓名是:"+xingming+"性别是:"+x+"爱好是:"+aihao);
}
}
</script>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="400" border="1" align="center">
<tr>
<td height="56" colspan="3"><div align="center">Register Here! </div></td>
</tr>
<tr>
<td width="80">姓 名:</td>
<td width="220"><label>
<input type="text" name="textfield" />
</label></td>
<td bgcolor="fffffffff"><span class="STYLE1">*必填项</span></td>
</tr>
<tr>
<td>性 别:</td>
<td><label>
男:<input type="radio" name="radio" value="男" id="nan"/>
女:<input name="radio" type="radio" value="女" id="nv" checked="checked" />
</label></td>
<td> </td>
</tr>
<tr>
<td>爱 好:</td>
<td>游泳:
<input type="checkbox" name="zhu2" id="zhu2" value="游泳" />
钓鱼:
<input type="checkbox" name="zhu2" id="zhu2" value="钓鱼" />
放牛:
<input type="checkbox" name="zhu2" id="zhu2" value="放牛" />
</td>
<td> </td>
</tr>
<tr>
<td height="56" colspan="3">
<div align="center">
<input type="submit" name="Submit" value="确定" onclick="javascript:aa();" />
<input type="submit" name="Submit2" value="重置" />
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
对一个复选框 用一个数组y[i]却不能输出,请在<script>中是不是数组设置有问题,感谢您的指点。