5 Replies Latest reply on Sep 11, 2015 1:12 PM by try67

    Help with javascript to replace field value with another field value

    discrhythmia Level 1

      Looking for some help with replacing a field value-

       

      I have created a button that runs a javascript to open an alert box with a yes/no answer.

      When yes is selected, I'd like to replace the values of six fields with other field values.  For simplicity sake, I have only included two of the fields rather than all six.  When I click the button, the first field replaces with the correct value, the second field (and all the remaining fields that I'm trying to replace their values) becomes blank.  I've tried a few different ways to enter the script and keep getting the same result.  Help would be greatly appreciated.

       

      // A MouseUp action

      // ask question with 'yes/no' take action on 'yes'

      if( app.alert({

      cMsg: "Do you want to create a new Daily Flight Sheet?", // message to display

      cTitle: "New Daily Flight Sheet Warning", // title for pop-up box

      nIcon: 2, // question icon

      nType: 2 // yes/no buttons

      }) == 4) {

      this.getField("rst1.Hour MeterForward").value=this.getField("rst.Hour MeterTotal").value;

      this.getField("rst1.LandingsForward").value=this.getField("rst.LandingsTotal").value;

      }