473,287 Members | 1,880 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

i want to display the radio button value in the table when selected that means if the

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html> <html> <head> <script type="text/javascript">     var holdPrevesScore=0;//holds evaluation of pervious person.      function sumOfEvaluation(form) {         var control, controls = form.elements;          var radios;           var totalScore = 0;     for (var i=0, iLen=controls.length; i<iLen; i++) {                  control = controls[i];           if ((control.type == 'radio') && control.checked) {                   var Score=Number(control.value);                   addrow(score,i);                 }                          }                }          function addrow(var scr, var indx){     var radioCount=0;     var newValue=scr;     var d=scr;     //creating element     var newTR = document.createElement("tr");     newTR.id = "tr" + ++radioCount;     var newTD1 = document.createElement("td");     var newTD2 = document.createElement("td");     var newTD3 = document.createElement("td");     var newTD4 = document.createElement("td");      var newTD5 = document.createElement("td");     var newTD6 = document.createElement("td");      var newTD7 = document.createElement("td");    // creating text nodes     var qustion_NO = document.createTextNode(indx);     var excellent = document.createTextNode(newValue);     var veryGood = document.createTextNode(newValue);     var good = document.createTextNode(newValue);     var satisfactory = document.createTextNode(newValue);     var poor = document.createTextNode(newValue);     var unknown = document.createTextNode(newValue);     // appending text node to elements       newTD1.appendChild(qustion_NO);        newTD2.appendChild(excellent);        newTD3.appendChild( veryGood);        newTD4.appendChild( good);        newTD5.appendChild(satisfactory);        newTD6.appendChild( poor);        newTD7.appendChild(unknown);       //append child th to element newTR       newTR.appendChild(newTD1);       newTR.appendChild(newTD2);        newTR.appendChild(newTD3);       newTR.appendChild(newTD4);       newTR.appendChild(newTD5);        newTR.appendChild(newTD6);       newTR.appendChild(newTD7);     //Insert new row at end of table.      var table = document.getElementById("dbRowsTable");      table.appendChild(newTR);            }              </script> </head> <body bgcolor="00FF66"> <center> <table id="dbRowsTable" border="1"> <tr><th>QUESTION NO</th><th>EXCELLENT</th><th>VERY GOOD</th><th>GOOD</th><th>SATISFACTORY</th><th>POOR</th><th>UNKNOWN</th></tr> </table> </center><br><br><hr><hr> <form name="quiz"> <h2><b>PART A </b></h2> <h3>THE INSTRUCTER </h3>                1.provides course outline &a relevant handouts that reflect the major content areas of the course in accordance with the catalog description and clearly defines objectives and expectations.                                           <ol> <input type="radio" name="q1" value="1">5                           <input type="radio" name="q1" value="0.75">4                            <input type="radio" name="q1" value="0.5">3                            <input type="radio" name="q1" value="0.25">2                            <input type="radio" name="q1" value="0.1">1                            <input type="radio" name="q1" value="0">N<br> </ol>                   2.Adequately covers the materials referenced in the online and explains how topics being discussed relate to the course objectives                   <ol> <input type="radio" name="q2" value="1">5                           <input type="radio" name="q2" value="0.75">4                            <input type="radio" name="q2" value="0.5">3                            <input type="radio" name="q2" value="0.25">2                            <input type="radio" name="q2" value="0.1">1                            <input type="radio" name="q2" value="0">N                         </ol>               3. presents course materials which are challenging and which forces students to work at maximum potential                        <ol> <input type="radio" name="q3" value="1" >5                           <input type="radio" name="q3" value="0.75" >4                            <input type="radio" name="q3" value="0.5" >3                            <input type="radio" name="q3" value="0.25" >2                            <input type="radio" name="q3" value="0.1" >1                            <input type="radio" name="q3" value="0" >N                         </ol> <input type="button" value="TOTAL EVALUATION" onClick="sumOfEvaluation(this.form);"> <input type="reset" value="CLEAR EVALUATION"><br><br> </form> </body> </html>
Jan 26 '16 #1
0 5371

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

Similar topics

1
by: Mokoena | last post by:
I can't seem to do an if statement check on the value returned from a selected radio button (isexistingleague). The code never runs anything within the if statement that tests if "true" is...
3
by: Flip | last post by:
In setting up a radio button group last night, I added two radio buttons, gave each of them their respective name and gave them both the same group name. So far so good. But then when I tried to...
4
by: yawnmoth | last post by:
I'm trying to display a popup showing which radio button is selected and am unable to do so. Every time I try, I get undefined, instead of the value of the particular form variable I'm trying to...
1
by: Bob Sanderson | last post by:
I have a form which uses several radio buttons to enter data. It works fine as far as entering goes, but I can't figure out how to display which button is checked when I view the record. I could do...
5
Claus Mygind
by: Claus Mygind | last post by:
In my script I used to test the value of the radio button to verify which button was selected. I was able to do that because all the buttons have the same name. If I want to use the the proper...
9
by: ameshkin | last post by:
Hi guys, I'm a pretty good PHP programmer, but when it comes to JS, I just dont understand it! But I really need to learn. I'm having trouble doing the simplest thing! When someone clicks...
1
by: lipton | last post by:
how can i compare a mysql table feild value with selected redio button value with php
0
by: Abhishek Nayak | last post by:
I want to put some questions with a data list view with multiple choice radio button so how to get each question answer or checked radio button value from list? i have this asp code: <asp:DataList...
0
by: peacemind | last post by:
Hi all, I have a 2 radio button . So i want to get the selected radio button value as it is stored in the data base . here's the code : echo"<tr> <td >Availability :...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.