File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Retain selected content in a JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Retain selected content in a JSP" Watch "Retain selected content in a JSP" New topic

Retain selected content in a JSP

yudi raj

Joined: Nov 11, 2011
Posts: 12
I have 2 jsp files: login.jsp and process.jsp....In login.jsp, I placed combo boxes and radio buttons. On selecting the values from the combo box and radio button and further submitting, the jsp displays process.jsp where it should retain the selected content. Here are both of my jsp files:



The radio button is not selected in the next page. However, I could retrieve the name through request.getParameter method. I think is something wrong in my javascript. Please let me know where I am going wrong. Thank you.
himanshu.harish agrawal
Ranch Hand

Joined: Oct 18, 2010
Posts: 47


Here you go

uday singh rajpurohit wrote:The radio button is not selected in the next page.

If you had noticed then your drop was not working as well.
Also, you are not getting Gender text displayed, I will leave this to you to figure the problem!

yudi raj

Joined: Nov 11, 2011
Posts: 12
Thanks Himanshu
chetan sisodiya

Joined: Nov 14, 2011
Posts: 12
uday singh rajpurohit wrote:Thanks Himanshu

Himanshu, the link you gave is I m familior with already. My problem is that I am not senting parameter to a diff page. I m posting dropdown's parameter on the same page. and on eveny ONCHANGE event on the first dropdown list proper result are reflectiung back on second parameter but the value of second drop down is set set back to default selected calue.. Is should be what I selected before.
I agree. Here's the link:
subject: Retain selected content in a JSP
Similar Threads
Getting the below error when doing formvalidation in spring
Display data from database to jsp page.
how to get form parameters data to a servlet?
not able to get values into database