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

Complex Formula Not Working - Re: Desperate - Newbie Needs Help with an "Either/Or" Formula

Gateway AZ
Registered: Feb 4 2011
Posts: 3
Answered

Referring to my earlier posting and using George's below example, I'm missing the boat somewhere because nothing is populating in my CheckAmount text field when I select one or the other of the 2 checkboxes. They have the same name but each has a different Export Value.
 
What am I doing wrong?
 
Custom calculation script reads:
 
var sFieldName = "CheckBox62"; // CheckBox62
event.value = ""; // assume no box is checked
if(this.getField(sFieldName).value != "Off") {
// a check box has been selected
event.value = this.getField(sFieldName).value;
}
 
Please advise at your earliest opportunity.
 
Thank you.
 
Gateway AZ

My Product Information:
Acrobat Pro 8.1.7, Windows
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi Gateway AZ,

Here is a tutorial on Conditional Statements from the Learning Center- it has a sample script for a checkbox condition statement to boot-


Conditional ExecutionHope this helps,

Dimitri
www.pdfscripting.com
www.windjack.com

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Accepted Answer
If you have check boxes with the exact same name, set the "Export Value" property of each box to the value you want to appear in the text box. For the "Custom calculation script" for the text field, you only need to test if the check box field has one of the check boxes checked. When a check box or radio button field or fields are not checked the value is 'Off', and if one of the fields is checked then the value is the export value for the specific item checked.

var sFieldName = "MyCheckBoxNameGoesHere"; // enter name of check box here
event.value = ""; // assume no box is checked
if(this.getField(sFeildName).value != "Off") {
// a check box has been selected
event.value = this.getField(sFieldName).value;
}

George Kaiser

Gateway AZ
Registered: Feb 4 2011
Posts: 3
George,

Mucho, mucho thanks for your quick reply! Your explanation and example really helps me to better understand this new world of formulas that I am entering into!! If I run into a problem, I'll repost.

Thanks again.

Gateway AZ
Gateway AZ
Registered: Feb 4 2011
Posts: 3
Please disregard previous post for help. My bloody computer was just running too slow. It worked!! Thanks again George!!!