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

Custom Calculation Problem

krickett47
Registered: Feb 4 2010
Posts: 18
Answered

Can anyone tell me what is wrong with this script?

var a = this.getField("201").value;
var b = this.getField("200").value;
var c = this.getField("213").value;
// compute the value
event.value = '';
if( c != 0) {
// perform only is b / c is not zero
event.value = b / c
}

Thanks!

My Product Information:
Acrobat Standard 9.0, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Exactly in what field and location are you placing this code?
Are you getting any error messages?
Are you getting any messages on the JavaScirpt console?
What is not working?

George Kaiser

krickett47
Registered: Feb 4 2010
Posts: 18
Exactly in what field and location are you placing this code? 210
Are you getting any error messages? No
Are you getting any messages on the JavaScirpt console? No
What is not working? I get a different answer everytime. Once I move on to another field I get the right answer. I think it may be in the order the fields are calculating, but I have never had to set the order before. Does this make sense?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Sounds like the calculation order of the fields as set by Acrobat is not the order you want. You will have to "Edit => Edit form in Acorbat" "Edit => Form Fields => Set Field calculation order"

George Kaiser

krickett47
Registered: Feb 4 2010
Posts: 18
Thanks! I tried changing the tab order but that didn't help. It did work when I changed the field calculation order.