首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

文本框数组~查了很久还是没找到解决方法

2012-01-24 
文本框数组~查了很久还是没找到解决办法~我想要将文本框数组的值传到text2.jsp的页面并输出text1.jsp的代

文本框数组~查了很久还是没找到解决办法~
我想要将文本框数组的值传到text2.jsp的页面并输出
text1.jsp的代码
<form   name= "form1 "   method= "post "   action= "text2.jsp ">
  <td   height= "28 "> </td>
  <%
      for(int     i=1;i <=3;i++){
      %>
    <tr   align= "center ">
      <td   height= "33 "> <input   name= "ckname[i] "   type= "text "   size= "20 "   > </td>
      <td   height= "33 "> <input   name= "ckpersonalcode[i] "   type= "text "   size= "20 "   > </td>
      <td   height= "33 "> <input   name= "cktel[i] "   type= "text "   size= "20 "   > </td>
        </tr>
      <%}%>
                               
      <input   name= "sure "   type= "submit "   value= "sure "   >
      </form>
text2.jsp的代码:
<%
                     
                      for(int   i=1;i <=3;i++){
                        String   a[]=request.getParameterValues( "ckname[i] ");
                        String   b[]=request.getParameterValues( "ckpersonalcode[i] ");
                        String   c[]=request.getParameterValues( "cktel[i] ");
                        }%〉
不知道用这种方法穿值对吗?可是我想要输出a[],b[],c[]的值,应该怎么做?谢谢大家先~

[解决办法]
text1.jsp的代码
<form name= "form1 " method= "post " action= "text2.jsp ">
<td height= "28 "> </td>
<%
for(int i=1;i <=3;i++){
%>
<tr align= "center ">
<td height= "33 "> <input name= "ckname[] " type= "text " size= "20 " > </td>
</tr>
<%}%>

<input name= "sure " type= "submit " value= "sure " >
</form>
text2.jsp的代码:
<%
String a[]=request.getParameterValues( "ckname[] ");
%〉

热点排行