This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have pasted below my code, I need to get two values & it pass to the VisitDetails Servlet. One is "visit_id" by radio button and second is "visit_type" but as per the below code I am getting only first row value of "visit_type" which fetched from the database. But when user will select any other row I needs that row's "visit_type" value only.
Your question is not clear make sure the forum members can understand what you exactly trying to say. Also dont put your code like this use the code tag option in forum and paste your code in it so users can understand easily.
So, while iterating you are getting <input type="radio" name="visitID" value="<%= visit_id%>" />
now in the same time dynamically generate hidden field as <input type="hidden" name="<%= visit_id%>" value="<%= visit_type%>" />
[HOPE visit_id is unique*]
i.e, now visit_type and visit_id is linked. now now you are getting visit_id on servlet right? now get the associated visit_type as String visitType = request.getParameter("visit_id");
another approach. use separator <input type="radio" name="visitID" value="<%= visit_id%>|<%= visit_type%>" />