开发者

How to get values of all input fields which have the same name? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.

I am using JSP for my webpage. I used JavaScript to get a dynamic textbox and it works fine. But, my problem is how to take the values to next page as the dynamic te开发者_Go百科xtboxes have all the same name?


If all input fields have the same name, use HttpServletRequest#getParameterValues() instead to grab the submitted values of all input fields with the same name. With getParameter() only the first one will be returned.

String[] values = request.getParameterValues("fieldname");

Unrelated to the concrete problem, you'd like to do the form processing job in a Servlet class instead of a JSP file. To learn more about Servlets, check our servlets info page.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜