Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

redirect to the same jsp on form submit

 
krishna gkv
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I have a jsp, which displays a multiple choice question with radio buttons. There are two buttons 'Submit' and 'Next'.
When a user selects an answer and submits the form, I want to display user with result saying correct or incorrect answer on the same jsp
page retaining the selected answer. Also the submit button should now be disabled and next button should be enabled.
I am using spring MVC.

When I am returning the same jsp from controller, the question with multiple options are displayed but the selected data is lost. Also the submit buttton is not disabled.
Any help is appreciated.
 
Vishal Shaw
Ranch Hand
Posts: 179
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I feel that's not required at all. You can submit your data with ajax and implement the logic accordingly.

But if you are adamant in using the current approach (as described by you), you can pass some parameters with the call to the specific page request. Based on that variable data, you can implement your requirement using javascript/jQuery.

Vishal
 
krishna gkv
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vishal,
I will try with Ajax call.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic