I would like to assign values to letters: A=0, B=1, C=2, D=3, E=4, F=5, G=6, H=7, I=8, J=9 and take user input from text field, for example ‘FAA’, and concatenate the number values of the user input, in the example FAA the value would be 500, then be able to take that value of, e.g., 500 (or whatever the value – if input were ECA the value would be 420) and perform a calculation with it, e.g., 2000 – (value of FAA) = 1500.
The specific application of this is an EchoSign PDF using JavaScript formulas in calculated fields that needs to take a ‘promotional code’ value input by the user, e.g., FAA, and deduct that amount from the full price field then show the new amount in the discounted price field.
JavaScript has the feature to treat strings to some extents like arrays.
Therefore, you could, for example set up a master string.
Then you loop through your instring and read out the index of the character in the masterstring
This forces restring to be a string; changing it to a number would be straightforward.