4 Replies Latest reply on Jul 10, 2017 7:46 PM by Duquette

    I am having difficulties identifying empty empty fields to populate other field

    Duquette Level 1

      I am using JavaScript to Identify whether or not a field is filled or empty. Depending on the results, It will assign variable to fill in the rest of the form. I cant seem to figure out what I am doing wrong. I have tried .isNull , .rawvalue, etc..... Any help would be appreciated.

       

      This is what I have so far.

       

      // Automatically Populates the Team Technician to the rest of the document once the field is populated on the Mileage Sheet and sets variables to predefined values;

      var team = this.getField("Team").value;
      var lead1 = this.getField("Lead1").value;
      var team1 = this.getField("Team1").value;


      event.value = "";

      if ((team.value !== null || team.value !== "")&&(lead1.value==null || lead1.value=="")){

                     event.value=team;

      }

      else if ((team.value == null || team.value == "")&&(lead1.value!==null || lead1.value!=="")){

                      event.value=lead1;


      }

      else if ((team.value == !null || team.value !== "")&&(lead1.value!==null || lead1.value!=="")){

                      event.value=team;

      }