
1. Re: Major javascript problem
MarkWalsh Jun 11, 2009 5:40 AM (in response to atmosphere01)There shouldn't be any problem; any fields that are empty should evaluate to 0 so that portion of your equation would not be added because it would be 0. e.g.  If G is empty and H was 20, then (G x (H/100)) = 0 x 20/100 = 0. If H is empty and G was 20, then (G x (H/100)) = 20 x 0/100 = 0. All of the other values would be added together if they all contained values. (This is assuming you have set the fields to number entry and won't have any nonnumeric characters)

2. Re: Major javascript problem
gkaiseril Jun 14, 2009 10:08 AM (in response to atmosphere01)You should acquaint yourself with the mathematical operators and ordering of execution so you can correctly write your code and simplify the bracketing.
The multiplication operator is "*".
If you use the 'Simplified field notation' in AcroForms you can use the following script:
(A * (B / 100)) + (C *( D / 100)) + (E * (F / 100)) + (G * (H / 100)) + (I * (J / 100)) + (K * (L / 100))
And because the execution order of the operators is to perform the multiplication and division before addition and subtraction and the associative law of multiplication and division, you do not even need the parenthesis for your situation.
If you were to write a 'Custom calculation script' one would need to use the "Number()' condtrictor to convert null values or empty fields to a numeric zero and not treat them as a character string. You can also use the 'isNaN()' function to test if a field's value is Not a Numeric value. Also if you use the number format for you input fields, you will have the entry values restricted to numeric values only and you can use the 'Validation' tab to restrict the range of numbers that can be entered.