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

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

2012-03-27 
求助jsp页面中取text值的问题定义了一组text,形式如下:inputtype text name text1 id 1 value.

求助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 ")

这样你会得到一个包含所有值的数组。。。。

热点排行