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

Adding up data fields in a form

mikediana
Registered: Oct 31 2007
Posts: 9

I am a very new user. In the vast sets of information for Acrobat 8 Professional on MAC could you please point me to an area where I can get some knowledge on how to sum/add simple number data i.e.10 to 30 in a vertical list of cells to a sum field below the list. The sum then needs to be exported (a separate problem). This is in a form where students list their prior achievements according to a points system.
With thanks
Mike

My Product Information:
Acrobat Pro 8.0999999999999996447286321199499070644378662109375, Macintosh
pddesigner
Registered: Jul 9 2006
Posts: 858
Create your form layout in MS Word with a space for a button for each numerical question.

Add a last page for the answers and provide space for a text field for each answer.

Convert the Word doc to PDF.

On the answers page, add text fields for each numerical answer. Set the apperance and format properties to number, one decimal place, seperator style 1234.56, currency symbol to none.

Name each text field in sequence (example: textInput.1, textInput.2, textInput.3 and etc.)


Go to the question page and add buttons for each question and place this code (with modifications) for the button up action JavaScript.

Button number 1 mouse up action JavaScript:

var t = this.getField("textInput.1"); // the target field on the answer page
var cResponse = app.response({
cQuestion: "What do you like about Acrobat?",//change this question to reflect yur question
cTitle: "Favorite Acrobat feature!"});//change this title to reflect the question title
{
if ( cResponse == null)
app.alert("Please complete the question."); // if Cancel is selected
else
app.alert("You responded, \""+cResponse+"\", is this correct?",2);
}
t.value = cResponse; // places the data from the dialog to the target field which is on the answer page.

Button number 2 mouse up action JavaScript:

var t = this.getField("textInput.2"); // the target field on the answer page. Notice the change for textInput to textInput.2
var cResponse = app.response({
cQuestion: "What do you like about Acrobat?",//change this question to reflect your question
cTitle: "Favorite Acrobat feature!"});//change this title to reflect the question title
{
if ( cResponse == null)
app.alert("Please complete the question."); // if Cancel is selected
else
app.alert("You responded, \""+cResponse+"\", is this correct?",2);
}
t.value = cResponse; // places the data from the dialog to the target field which is on the answer page.

Note: Keep adding buttons and text fields for each question making changes to the button and text field names. You can limit the number of characters for the text fields to any number you like on its Options tab.

The simpliest solution for this is to add text fields formated as numbers and a total field to sum the results.

My favorite quote - "Success is the ability to go from one failure to another with no loss of enthusiasm.