Hi, I'm pretty new to creating forms, so this may be a pretty basic question, but I couldn't find any info about this specific situation...
I'm trying to set up a check box so that it will populate a corresponding field with a specific number (a price) when it is checked; if the user then unchecks the box, the field would ideally become blank again.
In other words, let's say the user checks the box for "Option A", which costs $100. I want "100" to show up in a text field to the right. (There would be many of these check boxes, each with a corresponding field -- the prices in the fields then get added up into a total at the bottom.)
I'm pretty sure I'll have to use some javascript to make this happen, right? Any ideas on how I would do this?
I am using Acrobat 9 Pro to create the form, if that helps.
This script is placed in a Custom Calculation script in the text field that accepts the value when the check box is checked.
var myVal = getField("YourFieldNameHere");
if(myVal.isBoxChecked(0))
{
this.event.value = "100";
}
else
{
this.event.value = "";
}
The "0" (zero) at the end of the line that says "myVal.isBoxChecked(0)" designates the instance of the checkbox in this case "0" meaning "1".
StevenD