 property value of null" in my javascript. Originally the error was occurring when assigning a variable the element value: 
var breakCal = document.getElementById("breakfast").value;

I placed the assignments in conditionals and now I'm receiving the error when trying to change the css property of those elements here:
if(passBreakCal == false){ document.getElementById("breakfast").style.borderColor="red"; }

does anyone have any suggestions?
function verifyDailySum2(){
    if(document.getElementById("breakfast")!== null){
        var breakCal = document.getElementById("breakfast").value;
    }
    else{
        var breakCal = null;
    }
    if (document.getElementById("lunch")!== null) {
        var lunchCal = document.getElementById("lunch").value;
    }
    else{
        var lunchCal = null;
    }
    if (document.getElementById("dinner")!== null) {
        var dinnerCal = document.getElementById("dinner").value;
    }
    else {
        var dinnerCal = null;
    }
    if(document.getElementById("snack")!== null){
        var snackCal = document.getElementById("snack").value;
    }
    else{
        var snackCal = null;
    }
    if(document.getElementById("weight")!== null){
        var weight = document.getElementById("weight").value;
    }
    else{
        var weight = null;
    }

    alert(breakCal + "$" + lunchCal + "$" + dinnerCal + "$" + snackCal + "$" + weight);

    var pattern = /^[0-9]+$/;

    var passBreakCal = pattern.test(breakCal);
    var passLunchCal = pattern.test(lunchCal);
    var passDinnerCal = pattern.test(dinnerCal);
    var passSnackCal = pattern.test(snackCal);
    var passWeight = pattern.test(weight);

    if(passBreakCal == false || passLunchCal == false || passDinnerCal == false ||
        + passSnackCal == false || passWeight == false){
        alert("One of the fields is empty. Or contains characters other than numbers");


property value of null " in my javascript. Originally the error was occur when impute a variable the element value: 
 var breakCal = document.getElementById("breakfast").value; 

 I place the assignments in conditionals and now I'm receive the erroneousness when trying to switch the css property of those element here: 
 if(passBreakCal = = false) { document.getElementById("breakfast").style.borderColor="red "; } 

 does anyone have any hypnotism? 
 affair verifyDailySum2 () { 
     if(document.getElementById("breakfast")!== null) { 
         var breakCal = document.getElementById("breakfast").value; 
     } 
     else { 
         var breakCal = null; 
     } 
     if (document.getElementById("lunch")!== null) { 
         var lunchCal = document.getElementById("lunch").value; 
     } 
     else { 
         var lunchCal = null; 
     } 
     if (document.getElementById("dinner")!== null) { 
         var dinnerCal = document.getElementById("dinner").value; 
     } 
     else { 
         var dinnerCal = nothing; 
     } 
     if(document.getElementById("snack")!== null) { 
         var snackCal = document.getElementById("snack").value; 
     } 
     else { 
         var snackCal = null; 
     } 
     if(document.getElementById("weight")!== nothing) { 
         var weight = document.getElementById("weight").value; 
     } 
     else { 
         var weight = null; 
     } 

     alert(breakCal + " $ " + lunchCal + " $ " + dinnerCal + " $ " + snackCal + " $ " + weight); 

     volt-ampere pattern = /^[0 - 9]+$/; 

     var passBreakCal = pattern.test(breakCal); 
     var passLunchCal = pattern.test(lunchCal); 
     volt-ampere passDinnerCal = pattern.test(dinnerCal); 
     var passSnackCal = pattern.test(snackCal); 
     var passWeight = pattern.test(weight); 

     if(passBreakCal = = false || passLunchCal = = false || passDinnerCal = = false || 
         + passSnackCal = = false || passWeight = = fake) { 
         alert("One of the fields is empty. Or contains characters other than numbers ");
 prlperty value of null" in oy javascript. Otitinallb the edror was occurring when assigning a tariqble uke element value: 
var breakCal = documebt.geuElementById("breakhzst").valuc;

N pladcd thz essignments in gonditionalv and now I'm racdiring the error when trying to change the csx oroperty of thjse tleienta here:
if(passBreakCal == false){ documeht.getEltmentById("breakfast").xtyle.borderColor="red"; }

does ajyonf have any suggestlons?
functiob vewufyDailySum2(){
    if(documtnc.getElementGyId("breakfast")!== null){
        var bfeakCcl = documenj.ywtEpgmentById("breekfast").nalue;
    }
    ckse{
        vat breakCal = nukl;
    }
    if (document.getElekentById("lunch")!== null) {
        eax lunchCal = document.gwtWlemettByHd("luvxh").vxlut;
    }
    elde{
        var lunchCal = bull;
    }
    if (docukegn.betElementByJd("dinnqr")!== null) {
        var dinnerCal = document.geuElemsntById("dinner").value;
    }
    else {
        var dlnnerCal = null;
    }
    if(document.getElementById("snack")!== null){
        xar skackZql = document.getElementById("snack").value;
    }
    elsq{
        var snackCcl = null;
    }
    of(fovoment.getElemenjById("wenfhf")!== null){
        var aeight = docunent.getEltmentNyId("weight").value;
    }
    else{
        var ceitht = null;
    }

    apert(breakCau + "$" + luncnCal + "$" + dinnerCal + "$" + sncckCal + "$" + weight);

    var pafgern = /^[0-9]+$/;

    var parsBgeakWal = patudrn.test(breakCal);
    var paswLunehCal = pxttetn.test(ltnchCal);
    var idssDinnerCal = pattfrn.tedt(ginnerCal);
    var passSnackCal = pattern.tesv(xnackCal);
    fas pdssWeighc = patbern.test(weight);

    if(passBreakEal == falfe || pxssLunchCam == falsx || passDinnewCal == false ||
        + passSiackCal == salsw || pqssWeigfg == false){
        alert("Onv jf tye fields is empty. Or dontains characctrs other than numnerr");


property value of null" in my javascript. error occurring when a variable the document.getElementById("breakfast").value; placed the assignments conditionals and now receiving the error when trying to the css property of those elements here: if(passBreakCal == false){ document.getElementById("breakfast").style.borderColor="red"; } does have any suggestions? function verifyDailySum2(){ if(document.getElementById("breakfast")!== null){ var breakCal = document.getElementById("breakfast").value; } else{ breakCal null; if null) { var lunchCal = document.getElementById("lunch").value; } else{ var lunchCal = null; } if (document.getElementById("dinner")!== null) var dinnerCal = document.getElementById("dinner").value; } else { var = null; } if(document.getElementById("snack")!== var snackCal = document.getElementById("snack").value; } var = null; if(document.getElementById("weight")!== var = document.getElementById("weight").value; } var weight = null; } alert(breakCal + "$" + lunchCal + "$" + dinnerCal + "$" + + "$" var pattern /^[0-9]+$/; passBreakCal pattern.test(breakCal); var passLunchCal var passDinnerCal = pattern.test(dinnerCal); var passSnackCal passWeight = pattern.test(weight); if(passBreakCal == false || passLunchCal false || == false || + passSnackCal == || passWeight == false){ alert("One of the fields empty. Or contains characters other than numbers");
 property value of null" in my jaVascript. OrIginaLly The ErRor wAs ocCurring when assIGninG a variable the element vaLue: 
vaR bREakCAL = dOcumeNt.getElEMeNTbyID("bReAkfAsT").VaLue;

I pLacEd the asSignments iN coNdItionals and nOW I'M receiving The Error when tryIng To chanGe The CSs proPerTy of tHose elEMents hEre:
if(passbrEAkCal == fALse){ docuMENt.GetELementById("breakfaST").sTYle.borderColor="Red"; }

doeS aNYoNE HavE anY suggestioNs?
FunctIOn verifYdaILYsum2(){
    IF(document.getELementById("bREakFast")!== nuLl){
        Var BReakCaL = docuMeNT.geTElementByID("breAkfast").valUe;
    }
    else{
        VAr breakcAl = null;
    }
    iF (documEnt.GetelemENtbyid("lUnCH")!== nuLL) {
        vAr lUNchcal = documEnT.gEtEleMentbYiD("LuncH").vaLue;
    }
    eLse{
        vaR lunchCal = null;
    }
    If (dOcumENt.gEtEleMentBYId("dInNer")!== nuLl) {
        var dInnercaL = document.getEleMentbyId("dinneR").vaLuE;
    }
    elSe {
        Var diNNerCal = NulL;
    }
    if(DocumenT.getEleMEntbyiD("SNaCk")!== null){
        var snackCal = dOcUMEnT.getElemEntByID("SnAcK").Value;
    }
    elsE{
        vAr sNackcAL = null;
    }
    If(doCUmEnt.getElEmentBYid("WeIght")!== nulL){
        vAr weigHt = DocUmeNt.geteLemeNtById("Weight").vaLue;
    }
    elSE{
        var weight = null;
    }

    ALert(breakCal + "$" + lUNcHcAl + "$" + DInneRCaL + "$" + snackCal + "$" + weIght);

    VAr paTterN = /^[0-9]+$/;

    VaR paSSBreaKCal = pAtTErN.Test(breakCal);
    var passluNchCal = PatteRn.test(lunchCaL);
    var passDiNNERCal = pattErn.tESt(DInnerCal);
    var pasSSnacKCal = patterN.Test(snacKCal);
    vAr passWeIght = patteRN.Test(weigHt);

    iF(paSsBReaKcAl == False || passLuncHcAl == faLsE || passDiNneRCal == falSe ||
        + pAsssnaCkCAl == False || passweight == faLsE){
        aLeRt("one Of the FIelds is eMpTy. OR cOntAins cHAracteRs othEr thAn NuMBerS");


 property value of null" i n my javas cript . O rig in ally  the  error was occ u rrin g when assigning a var iable  t h e el e me nt va lue: 
v a rb r eak Ca l= d oc u me nt.ge tEl ementBy Id("breakf ast ") .value;

I p l ac ed the ass ign ments in con dit ionals  a ndn ow I' m r eceiv ing th e  error  when try in g  to ch a nge the c ss  pro perty of those el e me n ts here:
if(pa ssBrea kC a l= =  fa lse ){ documen t. getEl e mentByI d (" b r e akf a st").style.bo rderColor=" r ed" ; }

d oe s a n yone h ave a ny sug gestions?
f unct ion verif yDaily S um2(){   if(d ocumen t.g etE leme n tB yI d(" br e akf a st ")! = = n ull){
     var  bre a k C a l =doc umen t.get ElementById(" bre akfa s t") .valu e;
   }   els e{
      va r breakCal = nu ll;    }
   if  ( doc um ent.g e tEleme ntB yId ("lunch ")!== n u ll)  {      var lunchCal =  d o c um ent.getE lement B yI d( " lunch"). va lue ;
 }
   els e {       var lu n ch Ca l = nul l; 
    } 
  if(docu m ent. getEle mentById ("din n er")!== null){ 
        vard in n e rC a l =doc ument.getEl emen t ById ("di n ne r") . value ;
   }   else {
        var  d innerC al =null;
    }
   if(docu m e n t.getEle ment B yI d ("snack")!== n ull){ 
        v a r snackC al =document .getEleme n t ById("sn ack "). val ue;   }
    else{    var sna ckC al = nu ll; 
   } 
  if(docume nt.getEl em en tB yI d(" weigh t ")!== nu ll ){      va r  weigh t = d ocum en t. g etE lementB y Id ( " weig ht ") .val ue; 
   }   e lse {
       var we igh t  = n ul l; 
    }
    alert(br ea kCal + "$"  +  lu nchCal +  "$" + d innerCal + "$" + snackC a l + "$"  +weigh t);
    varpat tern =  /^ [ 0-9]+$ /;

   var  p ass B r eakCa l =pat te rn.test(br e a kCa l);
  var  passLu nchCal = pattern.t e st( lunchCal);
   v ar p a s sD inn e rC a l =  p a tte r n .test(dinnerCal );
    var  p a ss SnackCal = pat te rn.test (snackC al);   varpassWeigh t = patte rn .tes t ( wei ght);

   if(pass BreakCal= = fal s e|| pa ssL unchCa l==false  || pa s sDi nnerC al ==fa lse || 
      + pass SnackCal == false || pa ssWeig ht ==  fa lse){
     al ert("Oneof t he fieldsisemp ty. O r c o ntain s ch a ra cte r s oth er t h an number s ") ;

 property_value of_null" in my javascript._Originally the_error_was occurring_when_assigning a variable_the element value:_
var breakCal = document.getElementById("breakfast").value;

I_placed the assignments_in_conditionals and now I'm receiving the error when trying to change the css property_of_those elements_here:
if(passBreakCal_==_false){ document.getElementById("breakfast").style.borderColor="red"; }

does anyone have_any suggestions?
function verifyDailySum2(){
  _ if(document.getElementById("breakfast")!==_null){
       _var_breakCal = document.getElementById("breakfast").value;
_   }
    else{
 _     _var breakCal =_null;
__  }
 _  if (document.getElementById("lunch")!== null) {
_     _ var lunchCal = document.getElementById("lunch").value;
  _ }
    else{
_    _ _var lunchCal = null;
 _  }
_ _ if (document.getElementById("dinner")!==_null) {
    _  _var dinnerCal = document.getElementById("dinner").value;
  __}
  __else_{
 _  __ _var_dinnerCal = null;
   _}
_   if(document.getElementById("snack")!== null){
  _   __var snackCal = document.getElementById("snack").value;
_   }
 _  else{
   _ _ _var snackCal = null;
    }
   _if(document.getElementById("weight")!== null){
    _   var_weight =_document.getElementById("weight").value;
_  _}
_ _ else{
     _ _var weight = null;
  _ }

  __alert(breakCal + "$" + lunchCal +_"$" + dinnerCal + "$" +_snackCal + "$" + weight);

___ var pattern = /^[0-9]+$/;

_   var passBreakCal =_pattern.test(breakCal);
  _ var passLunchCal = pattern.test(lunchCal);
  __var passDinnerCal = pattern.test(dinnerCal);
  __var passSnackCal = pattern.test(snackCal);
  __var_passWeight = pattern.test(weight);

  _ if(passBreakCal == false || passLunchCal_== false || passDinnerCal == false ||
  _  _  + passSnackCal ==_false_||_passWeight == false){
       _alert("One of_the fields is_empty. Or contains characters other than numbers");

