File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes radio button values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "radio button values" Watch "radio button values" New topic

radio button values

meenakshi s venkateswaran

Joined: Apr 06, 2005
Posts: 2

I have some questions in a form which have 2 radio button type answers each. The qns are added by means of a for loop which means that the radio buttons have the same names. When the form is loaded, I am able to select only one, since the radio buttons have the same name. Can someone please help me so that I can assign the radiobuttons different names and access them in the servlet?

Thanks in advance
Abhinay Verma

Joined: Dec 13, 2004
Posts: 24
Hi Meenakshi,
Your page is generated dynamically. So, you can append the loop index to the name of the radio button. For example,

This will allow you to get the user selected values in your servlet. I hope this would solve your problem. Let me know if you have any queries.
[ April 11, 2005: Message edited by: Abhinay Verma ]
I agree. Here's the link:
subject: radio button values
It's not a secret anymore!