6 Replies Latest reply on Mar 11, 2014 2:09 PM by Naomi Kelly

    Help with Dropdown box autopopulating text

    Naomi Kelly

      I have created a dropdown box and set-it up with scripting to populate text fields based upon selection. The problem that I am having is when you make your selection it does not automatically update the text box. I have to click on another form field once I make a selection, then click on the text in the dropdown box. This will then result in the text fields auto populating. Could you please help, so that these extra steps will not need to be taken. Below is the coding that I used.

       

       

      var f = event.target;

       

      if (f.value == "Blank")

      {this.getField("TestMe").value = "";

      this.getField("InsuranceCodes").value = "";}

      if (f.value == "Aetna")
      {this.getField("TestMe").value = "";
      this.getField("InsuranceCodes").value = "90791 - Diagnostic Evaluation";
      this.getField("InsuranceCodes2").value ="90832/ 90834/ 90837 - Psychotherapy";
      this.getField("InsuranceCodes3").value ="90846 - Family Psychotherapy w/o Patient";
      this.getField("InsuranceCodes4").value ="90847 - Family Psychotherapy w/ Patient";
      this.getField("InsuranceCodes5").value ="96101 - Psychological Testing";
      this.getField("InsuranceCodes6").value ="96103 - Computer Testing";
      this.getField("InsuranceCodes7").value ="";
      this.getField("InsuranceCodes8").value ="";
      this.getField("InsuranceCodes9").value ="";}

      if (f.value == "Anthem BC")
      {this.getField("TestMe").value = "";
      this.getField("InsuranceCodes").value = "90791 - Diagnostic Evaluation";
      this.getField("InsuranceCodes2").value ="90832/ 90834/ 90837 - Psychotherapy";
      this.getField("InsuranceCodes3").value ="90846 - Family Psychotherapy w/o Patient";
      this.getField("InsuranceCodes4").value ="90847 - Family Psychotherapy w/ Patient";
      this.getField("InsuranceCodes5").value ="96101 - Psychological Testing";
      this.getField("InsuranceCodes6").value ="96103 - Computer Testing";
      this.getField("InsuranceCodes7").value ="";
      this.getField("InsuranceCodes8").value ="";
      this.getField("InsuranceCodes9").value ="";}