These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Error message fields don't match

kateh681
Registered: Jul 20 2011
Posts: 2

Hi, I'm pretty new to acrobat, but have a created several forms using the simple field notation tool. I have a form that does all of the calculations, but when I go to clear the form after testing, I keep getting an error message saying that the format of the fields doesn't match (but on the format tab, they do). You can click through the two messages and fill out the form, but the two "not matching" error messages come up after every field input. I can't have 50 people do this every time they need to use the form. I've googled this and one solution I found was to change the fomat of the two problem fields to "none" instead of a number. Which works, but the problem is that the form is used by lawyers and their assistants, and I don't know that they'll remember to round the two none numbers to get the proper monetary amount. So, I changed it back to the number for now. But I'm stuck. This is the last form for us to publish and then we start a new project. I've been trying to work out this error for three days. Any help getting the error message to disappear would be greatly appreciated. Thank you.
 
My field notation looks like this:
 
(twoweeks / dividedbydays) * fivesharp
 
totothers / almostquarter
 
wages_complete / wages_days * fivesharp
 
All of the calculations work, it's just gives me the fields don't match message when I clear the form. (And then if you go to fill it in again, without closing and re-opening, you get the error message as you fill in the entire document.)
 
If you need any other information, please let me know.
 
Thanks again!

My Product Information:
Acrobat Pro 9.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
The problem is your calculation contains division, so when the form is reset, you're in effect trying to divide by 0, which is not a legal operation.
The solution is to do the calculation using a script, taking into account the situation where the divisor is 0.

For example, you can replace this:
(twoweeks / dividedbydays) * fivesharp

with this:

event.value = "";
var twoweeks = getField("twoweeks").value;
var dividedbydays = getField("dividedbydays").value;
var fivesharp = getField("fivesharp").value;

if (dividedbydays!=null && dividedbydays!="" && dividedbydays!=0) {
event.value = (twoweeks / dividedbydays) * fivesharp;
}

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

kateh681
Registered: Jul 20 2011
Posts: 2
That fixed everything! You're amazing! Thank you!

p.s. Could you point me to some javascript for very beginners resources?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You're welcome.
I like this tutorial: http://w3schools.com/js/default.asp
It includes some great basic info, but be aware that some of the things that relate to browsers do not apply in Acrobat.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com