1
0
-1

Dear Team, 


i have 1 form for employee evaluation over and another one for HOD evaluation form., i am using HTML for doing this form, in the first form i have created the script for doing the sum of given value, its working fine ,.

and in second form for HOD he has to put his remarks where i have used same format but changed the field id and variable name also for doing the calculation, but the system is not displaying the sum of value her is the java script which i am using.

<script>

function hod_sum(){
var ec1,ec2,ec3,ec4,ec5,ec6,ec7,ec8,ec9,ec10,ec11,ec12,ec13,ec14,ec15,ec16,ec17,ec18,ec19,
ec20,ec21,ec22,ec23,ec24,ec25,ec26,ec27,ec28,ec29,ec30,ec31,ec32,ec33,ec34,ec35,sum;
ec1=Number(document.getElementById("rc1").value);
ec2=Number(document.getElementById("rc2").value);
ec3=Number(document.getElementById("rc3").value);
ec4=Number(document.getElementById("rc4").value);
ec5=Number(document.getElementById("rc5").value);
ec6=Number(document.getElementById("rc6").value);
ec7=Number(document.getElementById("rc7").value);
ec8=Number(document.getElementById("rc8").value);
ec9=Number(document.getElementById("rc9").value);
ec10=Number(document.getElementById("rc10").value);
ec11=Number(document.getElementById("rc11").value);
ec12=Number(document.getElementById("rc12").value);
ec13=Number(document.getElementById("rc13").value);
ec14=Number(document.getElementById("rc14").value);
ec15=Number(document.getElementById("rc15").value);
ec16=Number(document.getElementById("rc16").value);
ec17=Number(document.getElementById("rc17").value);
ec18=Number(document.getElementById("rc18").value);
ec19=Number(document.getElementById("rc19").value);
ec20=Number(document.getElementById("rc20").value);
ec21=Number(document.getElementById("rc21").value);
ec22=Number(document.getElementById("rc22").value);
ec23=Number(document.getElementById("rc23").value);
ec24=Number(document.getElementById("rc24").value);
ec25=Number(document.getElementById("rc25").value);
ec26=Number(document.getElementById("rc26").value);
ec27=Number(document.getElementById("rc27").value);
ec28=Number(document.getElementById("rc28").value);
ec29=Number(document.getElementById("rc29").value);
ec30=Number(document.getElementById("rc30").value);
ec31=Number(document.getElementById("rc31").value);
ec32=Number(document.getElementById("rc32").value);
ec33=Number(document.getElementById("rc33").value);
ec34=Number(document.getElementById("rc34").value);
ec35=Number(document.getElementById("rc35").value);


sum= (ec1 + ec2 + ec3 + ec4 + ec5 + ec6 + ec7 + ec8 + ec9 + ec10 + ec11 + ec12 + ec13
+ ec14 + ec15 + ec16 + ec17 + ec18 + ec19 + ec20 + ec21 + ec22 + ec23 + ec24 + ec25 + ec26 + ec27
+ ec28 + ec29 + ec30 + ec31 + ec32 + ec33 + ec34 + ec35 )
document.getElementById("hod_total").value= sum.toFixed(0);

}

</script>

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Run through each "document.getElementById" you have, probably the element has different ID in another form.

        CommentAdd your comment...