new here, absolute noob with programming, just tried to play around with pdf forms (using foxit phantom) and was able to figure some basics for calculations with javascript, for what I needed (really simple form). But this issue I don't know how to solve, nor how to search for answers properly, so any help/directions would be welcome. I'm trying something like this as a 'calculation' on a field:
var x=this.getField ("TextField1");
var y=this.getField ("NumberField1");
var z=this.getField ("NumberField2");
if (x.value = "A") {z.value=(50+y.value);}
else if (x.value = "B","C") {z.value=(100+y.value);}
else if (x.value = "D") {z.value=(200+y.value);}
else {z.value="Type an appropriate letter on TextField1"}
but when I enter it, it forces the TextField1 to be filled with "A" (or whatever I write on the first condition. The numeric sum is added correctly (for "A", 50+y) but if I try to type some other letter on TextField1, it erases and retus "A", forcing it to be the only thing on that field. Even after switching A to B on the first conditional, it does change to a forced "B" on the textfield1 but then the numerical sum is not adjusted to (100+y), but that seems to be yet another error due to my nonexistent experience with code past some c++...
The idea is to add into NumberField2 according to what the user types on TextField1 but the code forces the text into it.
This is probably absolutely trivial and sorry if this site is not the medium for such things, but I really had no idea what to search for on google.
