0 Replies Latest reply on May 26, 2011 12:44 PM by badgeteam

    How to use If/Else Statement in FormCalc

    badgeteam

      This works perfect if you are filling out the boxes across  the pain and are not trying something weird, which I found out our  customers do.  In this script all the prices are as they are per the  product if you filled in all the spaces before it. (Example: First Name, Last Name then the Title = This would equal 2 lines of Print)

       

      This is My current Script:

       

      if (Style.rawValue == "D13"){
          this.rawValue = 1.25;
          if (FirstName.rawValue != null){
              this.rawValue = 2.25;
          }
          if (LastName.rawValue != null) {
              this.rawValue = 2.95;
          }
          if (Title.rawValue != null){
              this.rawValue = 3.75
          }
          if (Branch.rawValue != null){
              this.rawValue += .50
          }
      }  

       

      What I am wondering is how to make it so that if you don't fill in the First Name or Last Name but want the Title Line on the product the product would then be 2.95 rather than 3.75. (Example: No Name but want Title as their 1 Line of Print)

       

      It would seem as though this is possible with If/Else, but I am not familiar enough with the language to know how to script it correctly.  The raw value of the D13 is 1.25 that is with nothing on it just the product and the Logo. It is the Lines of Print though that we have to charge for so I was hoping that if and else could help me here.

       

      Thank You for your help.

       

      Badgeteam