0 Replies Latest reply on Mar 5, 2015 12:36 PM by Sean.twyman

    text box population based on 2 other text boxes

    Sean.twyman Level 1

      I have some questions. First I am trying to change the contents of a text box depending on 2 other fields. The box to change is called Shipping and the two other fields to check are subtotal and customer number. For the shipping to be any # the other 2 fields have to meet a criteria. First the sub total has to be less that $250.00 then the customer # will start with 1 of 3 things CA, UT, or CO. IF both conditions are met then the shipping field will show “$9.00″. If the subtotal is less than $250.00 but the customer # does not start with one of the three items then the shipping field should show “$11.00″.

      If the subtotal is $250.00 or above, then no matter what the customer number starts with the shipping will show “$0.00″..

      Note I also have a check box that upon checked will change the shipping to “waived” if i chose to waive the shipping. I have some code but as you will see i am stuck on a few things. Any suggestions or advise you can give is greatly appreciated.

      var sb = this.getField("Sub Total");
      var cn = this.getField("Customer Number");
      var sh = this.getField("Shipping");
      if (sb.value < "250.00" && cn.startsWith ("CA" || "UT" || "CO")); {
        sh.value = '$9.00';
      if (sb.value < "250.00" && cn.Does not start With ("CA" || "UT" || "CO")); { //should be Does not start with
        sh.value = '$11.00';
      else if (sb.value >= "250.00") {
        sh.value = '$0.00';