当前位置: 代码迷 >> Java Web开发 >> jsp页面中取text值的有关问题
  详细解决方案

jsp页面中取text值的有关问题

热度:50   发布时间:2016-04-17 13:52:23.0
求助jsp页面中取text值的问题
定义了一组text,形式如下:
<input   type= "text "   name= "text1 "   id= "1 "   value=...>
<input   type= "text "   name= "text1 "   id= "2 "   value=...>
<input   type= "text "   name= "text1 "   id= "3 "   value=...>
<input   type= "text "   name= "text1 "   id= "4 "   value=...>
<input   type= "text "   name= "text1 "   id= "5 "   value=...>
<input   type= "text "   name= "text1 "   id= "6 "   value=...>


现在想取各text的value值,由于每个text的name值均相同,用request.getParameter( "text1 ")不能达到效果

不知是否有类似的函数,通过id来取值的?不胜感激。。。。

------解决方案--------------------
用request.getParameterValues( "text1 ")

这样你会得到一个包含所有值的数组。。。。
  相关解决方案