I haven't done any programming in years and it was basic C++ so I really don't know much about javascript. I'm working on a simple pricing pdf that I want user input in text fields to end up giving them their final price. Not sure if I am going about coding this correctly but lets say I am starting with two text fields. I make one text field "Num1" and another "Total". Now on my Num1 user input will be the quantity of the product but in the calculation coding I want it to calculate what that specific total will be from their quantity which is determined on different price breaks so I can call it up in my "Total" field later. I want the quantity to stay in the field though so I don't need the calculation to actually show up in that exact location. Here is how I am trying to work this on "Num1" text field :
var n1
if (this.getField("Num1").value <= 9)
{ n1 = this.getField("Num1").value * 15.74; }
else if (this.getField("Num1").value <25 && =>10)
{ n1 = this.getField("Num1").value * 9.25; }
else if (this.getField("Num1").value >=25 && <50)
{ n1 = this.getField("Num1").value * 7.40; }
else if (this.getField("Num1").value >=50)
{ n1.value = this.getField("Num1").value * 5.95; }
else { n1 = 0; }
With the hopes that when I get down to my "Total" field I can just add up n1 and other n#'s I have made from other text fields on the form
event.value = n1 + n2 + etc;
Now, I have no clue if I am even going about this in the correct way so some help would be much appreciated.