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

Calculations after importing fields of a tab.txt - database

hedrich
Registered: Nov 26 2008
Posts: 28

Hi,
I started creating a calclulation form based on a subtraction (java script works fine - thanks to the forum).

The first two form fields (A - B) contains data which were imported through the import of a tab.txt - database.

The next form field should present the final result - everything works fine until the tab.txt-database is imported. After the import the subtraction doesn't work.

Is there a chance to (a) import the tab.txt, (b) start the subtraction and (c) place the final result in a third form text field. I assume the third field must fulfill certain conditions ???

Any hints?

Kind Regards
Holger

My Product Information:
Acrobat Pro 9.0, Macintosh
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
You'll have to provide more details. Can you show the script you're using and tell us exactly where you've placed it (e.g., a custom calculation script for field C). How are you importing the data, exactly? Have you confirmed that the field calculation order is correct?

Can you clarify what you mean by: "I assume the third field must fulfill certain conditions ???"

George
hedrich
Registered: Nov 26 2008
Posts: 28
Hi George,

thanks for your prompt answer. With the help of the forum-support pages I've created a solution in the following way:

[img]http://www.content-vision.info/images/acro_forms.jpg[/img]

The two text-fields "Beginn des Studiums" and "Ende des Studiums" (view the picture above) contains data imported from a tab.txt-database.

WS 2000/01	SS 2008WS 1997/98	SS 2007...

The script for the the two text-fields looks the following way:

if(event.value == "SS 1994"){studium_beginn = 29.0;}else if(event.value == "WS 1994/95"){studium_beginn = 28.0;}else if(event.value == "SS 1995"){studium_beginn = 27.0;} ...

The calculation script for the third text-field (coloured yellow) contains the following code:

event.value = this.getField("studium_beginn").value - this.getField("studium_ende").value;
I think this is not a perfect solution, but it works ... !

[color=#FF0000][b]Another problem: Adding "Zeros" in front of a number[/color][/b]
But there is another problem concerning one of the other text fields. One text field contains the "matrikel"-number of the students (for example: 123456). These number must be changed to the format: "000000123456". Is there a script for adding "Zeros" in front of the imported number, until the number has 12 digits (with leading "Zeros") ??? I've posted this problem also in the javascript-section of the forum.

Kind Regards
Holger