Skip to main content
October 24, 2016
Question

Javascript only partally executing

  • October 24, 2016
  • 3 replies
  • 322 views

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"}

This topic has been closed for replies.

3 replies

Legend
October 24, 2016

Do you really have an exclamation mark on the fifth line? If so, take it off. If not, please check the JavaScript console for errors. You can copy/paste the console into a reply, that's usually best.

October 25, 2016

There is no exclamation, that is a copy/paste/typo error.  No errors are shown, it just seemingly executes random amounts of the code with no ryme or reason to how far it gets.  I'm just hoping someone has seen something like this before because it makes no sense.  Same starting conditions, no changes to the variables, but different results.

try67
Community Expert
Community Expert
October 25, 2016

Where did you place this code, exactly?