Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acrobat8 and javascript...need help

Status
Not open for further replies.

EricaB

Technical User
Sep 26, 2007
6
US
Hello,

I'm working on a form in Acrobat 8. On page one the user enters all their contact info and their age. On page 5 I have a section that tells them what their heart rate should be at/around. I would like this to automatically fill when their enter in their age in the beginning. So I created a text field next to the heart rate copy and under the Calculate tab I entered this javascript:
var n = "220";
var a = this.getField(age);
var p = ".5";
var s = "6";
function heartrate()
{
var hr = n - a * p / s;
document.write ("+hr+");
}
I'm not getting any errors, but also, nothing is calculating, my field is blank. Am I missing something?? The field that the user types in their age is called age.

The calulation my client uses to figure out the heart rate is as follows:
220 - age=Y then take 50,60,70,80, and 90 of Y, then divide each by 6

HELP!!!
Erica
 
I figured it out...I was doing it the hard way and by using the Simplified field notation I was able to make it work. I swear I tried that before and it didn't work.
(220 - age)*0.5/6

Thank you,
Erica
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top