Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
function myFunction() {
        var y = document.getElementById("subject1ca").value;
        var z = document.getElementById("subject1exam").value;
        var x = +y + +z;
        document.getElementById("total1").value = x;
}
function myFunction2() {
        var y = document.getElementById("subject2ca").value;
        var z = document.getElementById("subject2exam").value;
        var x = +y + +z;
        document.getElementById("total2").value = x;
}
function myFunction3() {
        var y = document.getElementById("subject3ca").value;
        var z = document.getElementById("subject3exam").value;
        var x = +y + +z;
        document.getElementById("total3").value = x;
}
function myFunction4() {
        var y = document.getElementById("subject4ca").value;
        var z = document.getElementById("subject4exam").value;
        var x = +y + +z;
        document.getElementById("total4").value = x;
}
function myFunction5() {
        var y = document.getElementById("subject5ca").value;
        var z = document.getElementById("subject5exam").value;
        var x = +y + +z;
        document.getElementById("total5").value = x;
}
function myFunction6() {
        var y = document.getElementById("subject6ca").value;
        var z = document.getElementById("subject6exam").value;
        var x = +y + +z;
        document.getElementById("total6").value = x;
}
function myFunction7() {
        var y = document.getElementById("subject7ca").value;
        var z = document.getElementById("subject7exam").value;
        var x = +y + +z;
        document.getElementById("total7").value = x;
}
function myFunction8() {
        var a = document.getElementById("total1").value;
        var b = document.getElementById("total2").value;
        var c = document.getElementById("total3").value;
        var d = document.getElementById("total4").value;
        var e = document.getElementById("total5").value;
        var f = document.getElementById("total6").value;
        var g = document.getElementById("total7").value;
        var h = +a + +b + +c + +d + +e + +f + +g;
        document.getElementById("total8").value = h;
}

cript
Posted
Comments
PIEBALDconsult 18-Dec-14 13:43pm    
If that code isn't causing trouble, then it doesn't belong in the question. Can you better describe what you are trying to accomplish?

1 solution

ok first,
am using dreamweaver to design a page via PHP
- having a table called attendance to monitor student who attends class
- the table sturcture is as follows
1.ID
2.Student_ID
3.Attendance i.e Absent Or Present
4.Date created i.e Timsetamp
5.Firstname
6.lastname
I created a database called "school" with two tables in it i.e "Studentreg""Attendance"

I wish i can upload the image of the table on the page but the table consists of
1. textfielf1=firstname
2.textfield=lastname
3.textfield=student_ID
4.listmenu=attendance
5.Hidden field
6.Button
A repeated region is then applied to the table thatr contains the text fields
..."Fistname" textfield and "lastname" textfield are populated from studentReg table i.e database school.

so my main issue is how to store multiple datas generated by the repeated regions with just a single submit button in to the database because i tried it alot of time and it stores just only one data instead of storing all the datas generated by the region.
here is the code view of the from
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form action="" method="POST" name="form1">



         
ID First Name Last Name Other Name Attendance
<input name="txtID" type="text" id="txtID" value="" /> <input name="firstname" type="text" id="firstname" value="" /> <input name="lastname" type="text" id="lastname" value="" /> <input name="othername" type="text" id="othername" value="" /> <select name="attendance" id="attendance">
<option selected="selected">---Choose---</option>
<option>Present</option>
<option>Absent</option>
</select>
<input name="ID" type="hidden" id="ID" value="" />        
        <input type="submit" name="Submit" value="Mark Attendance !" />

<input type="hidden" name="MM_insert" value="form1">
</form>
</body>
</html>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900