Good afternoon, I apologize for taking so long to get back to you. I create a variety of forms, generally to support clerical or programming/project development. Some are quite complicated.
The JS falls into two general areas for me: field calculation and entry validation.
One example for a multi-page form with a header, detail lines and a footer:
Standard “Page XX of YY” - I use a validation script to ensure Page_XX isn’t greater than Page_YY.
In the header there are two field containing strings to identify system properties, I’ll call them “Sys_Type” and “Sys_Level”. The user selects these from a dropdown box.
There are 32 detail lines (for example), and the labels are filled (read only) with a calculation script because if Page_XX == 1, the line numbers are 1-32, whereas, if Page_XX == 2, the line numbers are 33-64. If Page_XX == 3, the line numbers are 65-96, and so on.
The elements on the line include a description and a field name, which are simple entry boxes with input limits.
The next field is selected from a combo box I’ll call “DataType”, for which the options are “C”, “D”, “L” and “N”. The next field in the row is called “Data_Size” calculated as such:
Data_Type is evaluated to determine if it is fixed length or variable length. Types “C” and “N” turn read-only off for Data_Size and leaves that field blank for the user to enter a value. Types “D” and “L” store 8 and 1 (respectively) to Data_Size and Make it read-only.
The next column in the body is for decimal positions, and only applies if Data_Type is “N”, otherwise the formula that calculates Data_Size set it read-only.
The header counts the number of lines for which the size is not blank and adds that column to create a “number of fields” and “total record size” field.
This is a really simplified overview, as I’ve skipped a few columns and the calculation for field length also depends upon the selections made in “Sys_Type” and “Sys_Level” in the header.
I understand ONLYOFFICE has some macro functionality. Am I correct in assuming that wouldn’t work for a user with a different .pdf viewer? I distribute these forms to users on several platforms, and with the Javascript calculations, they can be used in Adobe products, or in browsers, LibreOffice or other office suites.
Thanks,
Dylan