473,406 Members | 2,713 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,406 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 5450

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 :...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.