3 Replies Latest reply on Oct 25, 2016 12:31 AM by try67

    Javascript only partally executing

    billr45377489 Level 1

      Despite being code-illiterate, I have managed to coble together a simple Javascript routine to autofill textboxes based upon a drop down. Initially it appeared to work fine however, as I added more getFields, only parts of the "if" statements were being executed (ie. it might only execute through getField("TORow1").value="EDW";  Any help is greatly appreciated.  Thanks!

       

      var Dropdown1=getField("Dropdown1").value

       

      getField("FLIGHTRow1").value="";

      getField("FLIGHTRow2").value="";

      getField("FLIGHTRow3").value="";

      getField("FLIGHTRow4").value="";

      getField("FLIGHTRow5").value=""; !

      getField("FLIGHTRow6").value="";

      getField("FLIGHTRow7").value="";

      getField("FLIGHTRow8").value="";

      getField("FLIGHTRow9").value="";

      getField("FLIGHTRow10").value="";

       

      if (Dropdown1=="KPMD Runway 07 to R2515"){
      getField("TRUE AIRSPEEDRow1").value="200";
      getField("POINT OF DEPARTURERow1").value="KPMD"
      getField("ALTITUDERow1").value="120";
      getField("FLIGHTRow1").value="PMD059027 PMD071014";
      getField("TORow1").value="EDW";
      getField("ETERow1").value="00+12";
      getField("Note1").value="XXXXX";
      getField("Note2").value="XXXXX";
      getField("Note3").value="XXXXX";
      getField("FUEL ON BD").value="24+00"}

       

      else if (Dropdown1=="Taylor Arc x2 (continuation)"){
      getField("TRUE AIRSPEEDRow1").value="330"
      getField("POINT OF DEPARTURERow1").value="BTY244044";
      getField("ALTITUDERow1").value="510B590";
      getField("FLIGHTRow1").value="OAL159048 OAL165031   OAL153033   OAL159048 HEC347051";
      getField("FLIGHTRow2").value="HEC359048 LAS209046  BLD192022   BLD118029  BLD148013";
      getField("FLIGHTRow3").value="BLD193023 LAS189035   LAS211047   HEC347051 OAL159048";
      getField("FLIGHTRow4").value="OAL165031 OAL153033  OAL159048   HEC347051  HEC359048";
      getField("FLIGHTRow5").value="LAS209046 BLD192022  BLD135022   BLD148013   BLD193023";
      getField("FLIGHTRow6").value="LAS189035 LAS211047  HEC347051";
      getField("TORow1").value="BTY244044";
      getField("ETERow1").value="02+45"

      getField("Note1").value="XXXXX";

      getField("Note2").value="XXXXX";

      getField("Note3").value="XXXXX";

      getField("FUEL ON BD").value="24+00"}