12 Replies Latest reply on Jun 10, 2013 11:49 AM by yeungyam

    app.alert asks question twice

    yeungyam Level 1

      I have a combobox that will ask a question anytime an entry is chosen. The problem is that when something is chosen, it asks the question twice. It reports the answer from the first time it asks the question, so I don't know and I can't figure out why it asks the question another time. I tried moving the question somewhere else in the script with no luck. This is my code:

       

      var cMsg = "Is this a Premium?"

      var nRtn = app.alert(cMsg,1,3,"Premium");

       

      if (!event.willCommit)

      {

      if(nRtn == 4)

      { // A Yes Answer

      this.getField("Premium1").value = 1;

      }

      else if(nRtn == 3)

      { // A No Answer

      this.getField("Premium1").value = 0;

      }

      else

      {

      }

       

      {    if (event.changeEx != " ")

              {

       

      if(this.getField("Date1_mm").value=="");

      this.getField("Date1_mm").value = util.printd ("mm", new Date());

       

      if(this.getField("Date1_yyyy").value=="");

      this.getField("Date1_yyyy").value = util.printd ("yyyy", new Date());

       

      this.getField("Date1_mm").required = false;

      this.getField("Date1_dd").required = false;

      this.getField("Date1_yyyy").required = false;

       

      } else {

       

      this.getField("Date1_mm").value = "";

      this.getField("Date1_dd").value = "";

      this.getField("Date1_yyyy").value = "";

       

      this.getField("Date1_mm").display = display.hidden;

      this.getField("Date1_dd").display = display.hidden;

      this.getField("Date1_yyyy").display = display.hidden;

       

                  }

              }

       

       

      }