Hello All!
Got a bit of JavaScript that doesn't seem to work properly.
The line is as follows:
var begin = this.getField("Class").value;
if (begin = 1) event.value = Math.floor((this.getField("CON").value + 9) + (this.getField("Level").value * 6));
else if (begin = 2) event.value = Math.floor((this.getField("CON").value + 7) + (this.getField("Level").value * 5));
else if (begin = 3) event.value = Math.floor((thisget.getField("CON").value + 6) + (this.getField("Level").value * 4));
It is tied to a dropdown box called "Class" and when you choose a choice, the field is supposed to do one of those three equations based on your choice. I've assigned all the proper export values, but the field seems to only display the value of the first equation. It doesn't change or alter when I change my choice. The other fields the equations tie to (Level and CON) change the value accordingly, but it doesn't seem to register the value or variable of the dropdown box. I thought it might be a 'calculate order' problem, but that doesn't seem to be it as it is in it's appropriate spot in the way the rest of the calculations occur. If I assign a simple box to display the "values" of the dropdown box, it works like it should.
Am I missing something?
You're doing the classic mistake of using the assignment operator ( = )
where you should use the comparison operator ( == ).
So in all of your if-statements, like:
if (begin = 1)
You need to use:
if (begin == 1)