读书人

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

发布时间: 2012-03-27 13:44:24 作者: rapoo

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

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

读书人网 >Java Web开发

热点推荐