This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Storing the value of a radio button

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am trying to store the values of radio button on a JSP page. Part of the HTML output of my JSP page is shown below:
<td width="82%">
<div class="page_title">Module Assessment 1</div>
<div><img src="images/spacer.gif" height="25"></div>
<table border="0" width="100%" align="center" width="100%">
<tr>
<th align="left" width="65%"></th>
<th class="small" width="5%">N/A</th>
<th class="small" width="5%">Strongly Agree</th>
<th class="small" width="5%">Agree</th>
<th class="small" width="5%">Neutral</th>
<th class="small" width="5%">Disagree</th>
<th class="small" width="5%">Strongly Disagree</th>
</tr>
<tr>
<td align="left">This module has given me a good understanding of the subject</td>
<td><input type="radio" name="1" id="1NA"> </td>
<td><input type="radio" name="1" id="1SA"> </td>
<td><input type="radio" name="1" id="1AG"> </td>
<td><input type="radio" name="1" id="1NE"> </td>
<td><input type="radio" name="1" id="1DI"> </td>
<td><input type="radio" name="1" id="1SD"> </td>
</tr>
<tr>
<td align="left">The module was well organised</td>
<td><input type="radio" name="2" id="2NA"> </td>
<td><input type="radio" name="2" id="2SA"> </td>
<td><input type="radio" name="2" id="2AG"> </td>
<td><input type="radio" name="2" id="2NE"> </td>
<td><input type="radio" name="2" id="2DI"> </td>
<td><input type="radio" name="2" id="2SD"> </td>
</tr>
etc...
How do I store the value that the user enters as their choice. I would like to store the value somehow into an access database using struts. I know how to access the database but am unsure where to start with storing the values of the radio buttons.
Many Thanks
Sheetal
 
Sheriff
Posts: 15815
264
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With Struts, you would create an ActionForm that has getters/setters for your form's fields.
See this tutorial: http://www.reumann.net/do/struts/main
 
Tongue wrestling. It's not what you think. And here, take this tiny ad. You'll need it.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic