By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,640 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,640 IT Pros & Developers. It's quick & easy.

Sum radio buttons on multiple tables on form w/jquery (java)

P: 2
Can someone please help? I'm new to coding. I have a form with mutiple tables and radio buttons. I'm trying to add a field or box at the end of each table that adds each radio button in that table. Then at the end of the last table I would like to sum the last table first, then add a field to give a grand total of each table.

Thank you,

Expand|Select|Wrap|Line Numbers
  1. <meta name="viewport" content="width=device-width, initial-scale=1">
  2. <style>
  3. table,th,td
  4. {
  5. border:1px solid black;
  6. border-collapse:collapse;
  7. }
  8. th,td
  9. {
  10. padding:5px;
  11. }
  12. </style>
  13.  
  14. <table style="width: 365px;">
  15. </table><font size="2"><b>
  16.   1</b>=Never | <b>2</b>=Seldom | <b>3</b>=Neutral | <b>4</b>=Occassionally | <b>5</b>=Always
  17. </font><table id="audit">
  18. <tbody><tr>
  19. </tr>
  20. <tr>
  21. </tr><tr bgcolor="#848484">
  22.   <th colspan="7"><font color="#ffffff" size="2" face="arial">LPA</font></th>
  23. </tr>
  24. </tbody><tbody>
  25.   <tr><th><font color="#045fb4" size="2">#</font></th>
  26.   <th><font color="#045fb4" size="2" face="arial">Description</font></th>                             
  27.   <th><font color="#045fb4" size="2" face="arial">1</font></th>
  28.   <th><font color="#045fb4" size="2" face="arial">2</font></th>
  29.   <th><font color="#045fb4" size="2" face="arial">3</font></th>
  30.   <th><font color="#045fb4" size="2" face="arial">4</font></th>
  31.   <th><font color="#045fb4" size="2" face="arial">5</font></th>
  32.   </tr>
  33. <tr>
  34. </tr><tr>
  35. </tr><tr bgcolor="#f2f2f2">
  36.   <td><font size="2" face="arial">1</font></td>
  37.   <td><font size="2" face="arial">Question 1</font></td>
  38.        <td style="text-align: center;">
  39.             <input name="radio-sort-1" value="1" type="radio">
  40.         </td>
  41.         <td style="text-align: center;">
  42.             <input name="radio-sort-1" value="2" type="radio">
  43.         </td>
  44.  <td style="text-align: center;">
  45.             <input name="radio-sort-1" value="3" type="radio">
  46.         </td>
  47.  <td style="text-align: center;">
  48.             <input name="radio-sort-1" value="4" type="radio">
  49.         </td>
  50.  <td style="text-align: center;">
  51.             <input name="radio-sort-1" value="5" type="radio">
  52.         </td>
  53.     </tr>
  54. <tr class="alt">
  55.   <td><font size="2" face="arial">2</font></td>
  56.   <td><font size="2" face="arial">Question 1</font></td>
  57.        <td style="text-align: center;">
  58.             <input name="radio-sort-2" value="1" type="radio">
  59.         </td>
  60.         <td style="text-align: center;">
  61.             <input name="radio-sort-2" value="2" type="radio">
  62.         </td>
  63.  <td style="text-align: center;">
  64.             <input name="radio-sort-2" value="3" type="radio">
  65.         </td>
  66.  <td style="text-align: center;">
  67.             <input name="radio-sort-2" value="4" type="radio">
  68.         </td>
  69.  <td style="text-align: center;">
  70.             <input name="radio-sort-2" value="5" type="radio">
  71.         </td>
  72.     </tr>
  73. </tbody></table><font size="2">
  74.  
  75. <br><br><br>
  76. <style>
  77. table,th,td
  78. {
  79. border:1px solid black;
  80. border-collapse:collapse;
  81. }
  82. th,td
  83. {
  84. padding:5px;
  85. }
  86. </style>
  87.  
  88. <table style="width: 365px;">
  89. </table><font size="2"><b>
  90.   1</b>=Never | <b>2</b>=Seldom | <b>3</b>=Neutral | <b>4</b>=Occassionally | <b>5</b>=Always
  91. </font><table id="audit">
  92. <tbody><tr>
  93. </tr>
  94. <tr>
  95. </tr><tr bgcolor="#848484">
  96.   <th colspan="7"><font color="#ffffff" size="2" face="arial">LPA</font></th>
  97. </tr>
  98. </tbody><tbody>
  99.   <tr><th><font color="#045fb4" size="2">#</font></th>
  100.   <th><font color="#045fb4" size="2" face="arial">Description</font></th>                             
  101.   <th><font color="#045fb4" size="2" face="arial">1</font></th>
  102.   <th><font color="#045fb4" size="2" face="arial">2</font></th>
  103.   <th><font color="#045fb4" size="2" face="arial">3</font></th>
  104.   <th><font color="#045fb4" size="2" face="arial">4</font></th>
  105.   <th><font color="#045fb4" size="2" face="arial">5</font></th>
  106.   </tr>
  107. <tr>
  108. </tr><tr>
  109. </tr><tr bgcolor="#f2f2f2">
  110.   <td><font size="2" face="arial">1</font></td>
  111.   <td><font size="2" face="arial">Question 1</font></td>
  112.        <td style="text-align: center;">
  113.             <input name="radio-sort-1" value="1" type="radio">
  114.         </td>
  115.         <td style="text-align: center;">
  116.             <input name="radio-sort-1" value="2" type="radio">
  117.         </td>
  118.  <td style="text-align: center;">
  119.             <input name="radio-sort-1" value="3" type="radio">
  120.         </td>
  121.  <td style="text-align: center;">
  122.             <input name="radio-sort-1" value="4" type="radio">
  123.         </td>
  124.  <td style="text-align: center;">
  125.             <input name="radio-sort-1" value="5" type="radio">
  126.         </td>
  127.     </tr>
  128. <tr class="alt">
  129.   <td><font size="2" face="arial">2</font></td>
  130.   <td><font size="2" face="arial">Question 1</font></td>
  131.        <td style="text-align: center;">
  132.             <input name="radio-sort-2" value="1" type="radio">
  133.         </td>
  134.         <td style="text-align: center;">
  135.             <input name="radio-sort-2" value="2" type="radio">
  136.         </td>
  137.  <td style="text-align: center;">
  138.             <input name="radio-sort-2" value="3" type="radio">
  139.         </td>
  140.  <td style="text-align: center;">
  141.             <input name="radio-sort-2" value="4" type="radio">
  142.         </td>
  143.  <td style="text-align: center;">
  144.             <input name="radio-sort-2" value="5" type="radio">
  145.         </td>
  146.     </tr>
  147. </tbody></table><font size="2">
  148.  
  149. <br><br><br>
  150.  
May 6 '14 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.