jQuery in Action, 2nd edition*
The moose likes JSP and the fly likes Radio button value with submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Radio button value with submit" Watch "Radio button value with submit" New topic
Author

Radio button value with submit

Frederik Ericsson
Ranch Hand

Joined: Apr 27, 2005
Posts: 128
Hello Friends,

I am retriving some records from DB and displaying in jsp, each record with one radio button which is generated dynamically.
and I have one submit button at the bottom of all records. once I select the radio button and press submit, I have to get the vaue of selected
radio button record, with that value I have to pull some more record from DB.

1. how to get the get the selected radio button value when i press the submit button.

2. with that value I have to call the java class, how to do that?


can you show some code to do that.

please help me out.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60785
    
  65

Originally posted by Frederik Ericsson:
1. how to get the get the selected radio button value when i press the submit button.
If all of the radio buttons have the same name, and each has a unique value, then a request parameter that you would obtain with request.getParameter() will be submitted with the specified name and the selected value.

2. with that value I have to call the java class, how to do that?

Not sure what you mean by this. Once you have the value you can do anything you want with it.
[ May 14, 2007: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
 
subject: Radio button value with submit
 
Similar Threads
using html:radio
Pass radio button/ text box responses from one page to another
checkbox
Populating fields with data on clicking radio button
exract the values of a row which is dynamically generated