![]() You can find out more about field naming on the PDF Form Scripting page. Field naming is a topic all by itself and is very important when dealing with complicated forms and calculations. It is important to note that this part of the script will fail if field names in the script do not exactly match the field names on the form, including upper case letters. When you use it in your own scripts be careful to make sure the name of your particular field is enclosed in quotes. The important part to know here, is that the code - this.getField("InputA").valueAsString, returns the value of the InputA field as a text string. We're not going to get deep into the details of JavaScript coding, but we are going to have to cover a few things. One field is named InputA and the other is named InputB. For this script the data is acquired from two fields. There are other places where data can be acquired, but let's stick with the simplest case. Generally, the values used in a PDF form calculation are acquired from other form fields. However, not only is it instructive to explicitly show the individual parts, but these parts need to be separate for more complicated calculations.Īlso, while the calculation is simple, there is actually a lot going on here. ![]() This calculation is so simple that it could easily be done in a single line of code. Var nB = Number(this.getField("InputB").valueAsString) Var nA = Number(this.getField("InputA").valueAsString)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |