Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSP and Radio Buttons

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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">
 
I RELEASE YOU! (for now .... ) Feel free to peruse this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic