    function updatebox() {
       var am_bslip = document.getElementById('am_bslip').value;
       var am_mobile = document.getElementById('am_mobile').value;
       var am_cash = document.getElementById('am_cash').value;
       var am_cheque = document.getElementById('am_cheque').value;
       var am_banktfer = document.getElementById('am_banktfer').value;


       if (am_bslip == "")
           {am_bslip = 0;}
       if (am_mobile == "")
           {am_mobile = 0;}
       if (am_cash == "")
           {am_cash = 0;}
       if (am_cheque == "")
           {am_cheque = 0;}
       if (am_banktfer == "")
           {am_banktfer = 0;}

       var moptotals = parseInt(am_bslip) + parseInt(am_mobile) +parseInt(am_cash)+parseInt(am_cheque)+parseInt(am_banktfer);
       if (!isNaN(moptotals)) {
           document.getElementById('moptotal').value = moptotals;
       }
 }

     function updatereceived() {
       var p_fees = document.getElementById('p_fees').value;
       var p_uniform = document.getElementById('p_uniform').value;
       var p_contribution = document.getElementById('p_contribution').value;
       var p_registration = document.getElementById('p_registration').value;
       var p_holiday = document.getElementById('p_holiday').value;
       var p_admission = document.getElementById('p_admission').value;
       var p_transport = document.getElementById('p_transport').value;
       var p_mockfa = document.getElementById('p_mockfa').value;
       var p_other1 = document.getElementById('p_other1').value;
       var p_other2 = document.getElementById('p_other2').value;
       var p_other3 = document.getElementById('p_other3').value;

       if (p_fees == "")
           {p_fees = 0;}
      if (p_uniform == "")
          {p_uniform = 0;}
      if (p_contribution == "")
          {p_contribution = 0;}
      if (p_registration == "")
           {p_registration = 0;}
      if (p_holiday == "")
           {p_holiday = 0;}
      if (p_admission == "")
           {p_admission = 0;}
      if (p_transport == "")
           {p_transport = 0;}
      if (p_mockfa == "")
           {p_mockfa = 0;}
      if (p_other1 == "")
           {p_other1 = 0;}
      if (p_other2 == "")
           {p_other2 = 0;}
      if (p_other3 == "")
           {p_other3 = 0;}

  
       var receivedtotals = parseInt(p_fees)+parseInt(p_uniform)+parseInt(p_contribution)+parseInt(p_registration)+parseInt(p_holiday)+parseInt(p_admission)+parseInt(p_transport)+parseInt(p_mockfa)+parseInt(p_other1)+parseInt(p_other2)+parseInt(p_other3);
       if (!isNaN(receivedtotals)) {
           document.getElementById('receivedtotal').value = receivedtotals;
       }
 }

 function FormValidation(){
      var moptotal=document.getElementById('moptotal').value;
      var receivedtotal=document.getElementById('receivedtotal').value;

      if(moptotal!==receivedtotal){alert('Wait!!! M.O.P total not equal to Received total');
      return false;}
}

