Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

collection of radio buttons  RSS feed

 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an index page which displays 10 set of questions. Each question has a radio button group.

Ex:

Q1) Which state do you live?
.NY .MO .CT (there are radio buttons)
Q2) Which is your favorite color?
.red .blue .green
Q3) Which is your favorite food?
.burger .pizza .chicken
Q4) ........and so on

I have a hyperlink(next) on this page when clicked i need to capture all the answers for these questions i.e., i need to store collection of radio button answers. do i need to have 10 get/set methods with the same name as of radio button names in the form to capture answer for each question? and when i click the link how do i caputure the form values?? How do i do that?? any ideas??

Thanks in advance,
 
author & internet detective
Marshal
Posts: 38146
617
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of having your hyperlink go to the next page, have it call a javascript function that submits the form. You can them have a Struts action forward to the next page.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!