5 Replies Latest reply on Jun 29, 2015 2:46 PM by jring1000

    Convert text string to number

    jring1000

      I have two fields, Combo1 and Price1. The Combo1 field includes a list of five items. Each item is a string of text. I need the Price1 field to change based on the selected item in the Combo1 field. Follows is what I'm currently using:

       

      var n = this.getField("Combo1").value;

       

      if (n = "Text String Item No. 1") {

          event.value = 150;

      }

      else if ("Text String Item No. 2") {

          event.value = 125;

      }

      else if ("Text String Item No. 3") {

          event.value = 150;

      }

      else if ("Text String Item No. 4") {

          event.value = 200;

      }

      else if ("Text String Item No. 5") {

          event.value = 0;

      }