473,473 Members | 1,988 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

2 New Member
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
0 1244

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

Similar topics

1
by: kim | last post by:
I'm trying to check my radio buttons before the form is submitted. The radio button names are the same(pend) because only one should be selected. I also would like to know how to make sure if a...
3
by: Ken Varn | last post by:
This is probably a simple question, but I am new to this so bear with me. I have a ASP.NET form that has a checkbox and a 2 radio buttons. When the checkbox is checked, the 2 radio buttons are...
2
by: James P. | last post by:
Help, I need to display radio buttons on a form. The data is from SQL table: each row in each table is displayed as a radio button. I have multiple SQL tables so I understand I need to put...
6
by: shror | last post by:
i want to add a midi file to my pages and i want to put two radio buttons so that on is on and the other is off so that the users can start or stop the file playing by choosing one of the radio...
3
by: santoshsri | last post by:
Hi, I have two checkboxes : Chkcities(0) and Chkcities(1) . I want that when user checks one box by single click other box should be unchecked and vice versa. I have used below code for this : ...
7
by: help4me | last post by:
Hope someone can help me out with this. I'm having trouble getting my radio button values into a MySQL database. And after I do get them inserted I'm going to want to be able to show them back in...
1
by: Lazairus | last post by:
simply how do you set enums in a database using coorsoponding radio button from a html form now i have a table client_membership in mysql with the membership_type enum('six','one') i...
3
by: mringuk | last post by:
I have included a feedback form within my Flash Site which contains two sets of Yes/No RadioButtons. The Form text fields are interfacing with the PHP correctly but the two questions with...
7
by: gengyue | last post by:
Hi, I am running a report using Cold Fusion. This report is generated by cfloop tag. Depends on the record count of a query, the report will list the data retrieved from the database. each row in...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.