
1. Re: I am attempting to develop a pdf form that will perform calculations based on user input. I have been able to accomplish some of the more basic calculations, such as multiplication, but am having trouble when it comes to performing some of the more co
jcmolin Nov 29, 2017 11:41 AM (in response to jcmolin)I believe my problem statement was cut off. Here is it: I am attempting to develop a pdf form that will perform calculations based on user input. I have been able to accomplish some of the more basic calculations, such as multiplications, but am having trouble when it comes to performing some of the more complex calculations. I am attempting to perform the following calculation (29.84*UserEntry1*sqrt(UserEntry2)*(UserEntry3^2). I have read several forums and I understand that adobe pro uses JavaScript, so I have attempted to incorporate commands such as Math.pow("UserEntry3",2). I have also tried Math.pow(this.getField("UserEntry3").value*1,2). In a similar fashion I have attempted to use the Math.sqrt function with no luck. I do not receive an error with my equation. The box simply is unresponsive to any user input values. Any ideas as to what could be the issue?

2. Re: I am attempting to develop a pdf form that will perform calculations based on user input. I have been able to accomplish some of the more basic calculations, such as multiplication, but am having trouble when it comes to performing some of the more co
George_Johnson Nov 30, 2017 8:56 AM (in response to jcmolin)The custom calculation script for the field could be something like:
// Custom calculation script for text field
(function () {
// Get the field values, as numbers
var v1 = +getField("UserEntry1").value;
var v2 = +getField("UserEntry2").value;
var v3 = +getField("UserEntry3").value;
// Perform the calculation and set this field's value
event.value = 29.84 * v1 * Math.sqrt(v2) * Math.pow(v3, 2);
{)();
When troubleshooting JavaScript, it is helpful to check the JavaScript console (Ctrl+J) for errors.

3. Re: I am attempting to develop a pdf form that will perform calculations based on user input. I have been able to accomplish some of the more basic calculations, such as multiplication, but am having trouble when it comes to performing some of the more co
jcmolin Dec 1, 2017 8:04 AM (in response to George_Johnson)Thank you! That worked great! so if i would want to follow up with the following calculation: AutoCalc1*((UserEntry2  20)/(UserEntry2  UserEntry3))^0.54).
Shouldn't the following script work:
var v1 = +getField("AutoCalc1").value;
var v2 = +getField("UserEntry2").value;
var v3 = +getField("UserEntry3").value;
event.value = v1 * Math.pow(((v2  20)/(v2  v3)), 0.54);
I am being prompted with a window that says the value entered does not match the format of the field. Don't quite understand the issue.

4. Re: I am attempting to develop a pdf form that will perform calculations based on user input. I have been able to accomplish some of the more basic calculations, such as multiplication, but am having trouble when it comes to performing some of the more co
try67 Dec 1, 2017 8:10 AM (in response to jcmolin)You need to make sure that the result of v2v3 is not zero, as that would mean division by zero, which is not allowed.

5. Re: I am attempting to develop a pdf form that will perform calculations based on user input. I have been able to accomplish some of the more basic calculations, such as multiplication, but am having trouble when it comes to performing some of the more co
gkaiseril Dec 3, 2017 9:26 AM (in response to jcmolin)Change the format of the field to "None" and observe what appears. It could be "NaN", a number expressed in scientific notation, "Infinity", or "Infinity". You can then adjust your script to handle the result in an appropriate manner.