Copy link to clipboard
Copied
I developed a form that is essentially a calculator. After calculating a variety of fields provides the end-user with what they need to perform other functions. I have all the calculations working and providing me the correct result, but I added a clear form button and it is throwing 2 errors on 2 fields that have division calculations. After trying different scripts that I've gleaned off of this site, I can not resolve the issue. Hoping someone can assist. I've attached the form and the errors are coming from Feild "Text23" and "Text58"
Thanks in Advance
Copy link to clipboard
Copied
This happens when you divide by zero. Read this:
Copy link to clipboard
Copied
Error is because you try to divide with zero.
For "Text23" replace:
if(a==0)event.value="";
if(b==0)event.value="";
if(c==0)event.value="";
with:
if(b==0) event.value="";
Because var b is only one in that calculation that can divide with zero, that should fix your error. If you want field to be empty if any of the fields is empty then use like this:
if(a==0 || b==0 || c==0) event.value="";
For "Text58" also use custom calculation script instead of SFN and check for division with zero, you should also check your other calculations too for division with zero and correct it.
Copy link to clipboard
Copied
Nesa, thank you. That worked and I have checked and changed all other SFN to custom script
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more