开发者

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

开发者 https://www.devze.com 2023-02-18 14:53 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
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

精彩评论

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