This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP and Radio Buttons 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 "JSP and Radio Buttons" Watch "JSP and Radio Buttons" New topic
Author

JSP and Radio Buttons

Marylou Thompson
Greenhorn

Joined: Jun 23, 2003
Posts: 1
I have a JSP with a select box,radio buttons, and a submit button. The user will make a select from the select box and click on one of the radio button. When the submit button is clicked on the JSP redirects to another JSP that needs to determine the value from the select box (which works) and determine which radio button is checked. The 2nd JSP saves the value from the select box using request.getParameter(select box name). However, I can't determine which radio button is "on". How should I do this?
Vijay S. Rathore
Ranch Hand

Joined: Oct 29, 2001
Posts: 449
Hi Marylou Thompson,
Give your radio buttons a different name but put them in the same group. e.g
<input type="radio" name="RB" value="rb1">
<input type="radio" name="RB" value="rb2">
<input type="radio" name="RB" value="rb3">
<input type="radio" name="RB" value="rb4">


SCJP, SCJD, SCWCD1.4, IBM486, IBM484, IBM 483, IBM 287, IBM141, IBM Certified Enterprise Developer - WebSphere Studio, V5.0
Author of IBM 287 Simulator Exam
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP and Radio Buttons
 
Similar Threads
Radio button value with submit
Pass radio button/ text box responses from one page to another
Writting controller.jsp
retrieving dynamic values in jsp
Value from select element is null in request