aspose file tools*
The moose likes JSP and the fly likes Pass radio button/ text box responses from one page to another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Pass radio button/ text box responses from one page to another" Watch "Pass radio button/ text box responses from one page to another" New topic
Author

Pass radio button/ text box responses from one page to another

madhankumar kumaravelu
Greenhorn

Joined: Nov 30, 2011
Posts: 17

Hello

I have a jsp screen1 with lot of radio buttons and a text box.

Once some of these radio buttons are selected and text box typed with a value
and submit button clicked, it has to update the postgre DB with the selected radio
button's text and the text box value.

On successfull updation of DB, it has to redirect to a jsp screen 2.

Currently i have the jsp screen 1 but i dont know how to get responses and proceed.

Please help me with a sample code.

It is urgent!

Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1027
Sounds simple enough...

The form on jsp screen 1 has to have an action that will invoke a servlet




In your servlet doPost method, you retrieve the values of the parameters with request.getParameter(), and then invoke some JDBC code to save them.


and then get a request dispatcher and forward to the next jsp:

subbu kanna
Greenhorn

Joined: Jan 11, 2012
Posts: 4

hello sir,

String selectedRadio = request.getParameter("radioControlName");
String inputText = request.getParameter("textfieldControlName");

the request.getparameter("radiocontrolname") if null then how do we check it

if(request.getParameter("radio")==null)
out.println("user did not choosen");

but the if condition not checking, I have this problem in jsp registration page . please guide me in this regard


regards
kanna
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pass radio button/ text box responses from one page to another