• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to persist user previous selection of radio button  RSS feed

 
Mahtab Alam
Ranch Hand
Posts: 391
1
Java MySQL Database PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am making a quiz app and stuck with this problem.

User is presented with question with options he select one radio button and move on to next question by clicking next button.

Now when user clicks on the previous button to change the previous selction , I want his previous selection to be shown selected.

How can I do that.
 
Piet Souris
Rancher
Posts: 1943
66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Mathab,

one easy way is to maintain a Map<Question, JRadioButton>, or
Map<Integer, Integer>, for the choices made. Or simply a List<Integer>,
assuming the questions are always in the same sequence.

Greetz,
Piet

Edit:
just noticed this question is in the JSP forum. Hope there
are similar contructions in JSP.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!