I wrote a post yesterday asking how to do this. I received a reply sending me to this article written by Thom Parker:
http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/change_another_field/
i have followed the directions, and i do not receive any errors, however when i try it out in my pdf doc, it does not work.
Here's my code:
var DegreeData = { "Astronomy and Astrophysics":{ tuition: "$36,666",
activitiesfee: "$135",
healthservicefee: "$504",
tuitionsubtotal: "$37,305",
healthinsurance: "$1,770",
books: "$1,740",
livingexpenses: "$14,130",
other: "$4,170",
livingexpensessubtotal: "$21,810" },
"Biological Sciences Division":{ tuition: "$46,596",
activitiesfee: "$135",
healthservicefee: "$672",
tuitionsubtotal: "$47,403",
healthinsurance: "$1,770",
books: "$1,740",
livingexpenses: "$18,840",
other: "$0",
livingexpensessubtotal: "$69,753" }};
function SetFieldValues(cDegreeProgram)
{
this.getField("Tuition").value = DegreeData["Astronomy and Astrophysics"].tuition;
this.getField("Activities Fee").value = DegreeData["Astronomy and Astrophysics"].activitiesfee;
this.getField("Health Service Fee").value = DegreeData["Astronomy and Astrophysics"].healthservicefee;
this.getField("Tuition Subtotal").value = DegreeData["Astronomy and Astrophysics"].tuitionsubtotal;
this.getField("Health Insurance").value = DegreeData["Astronomy and Astrophysics"].healthinsurance;
this.getField("Books").value = DegreeData["Astronomy and Astrophysics"].books;
this.getField("Living Expenses").value = DegreeData["Astronomy and Astrophysics"].livingexpenses;
this.getField("Other").value = DegreeData["Astronomy and Astrophysics"].other;
this.getField("Living Expenses Subtotal").value = DegreeData["Astronomy and Astrophysics"].livingexpensessubtotal;
this.getField("Tuition").value = DegreeData["Biological Sciences Division"].tuition;
this.getField("Activities Fee").value = DegreeData["Biological Sciences Division"].activitiesfee;
this.getField("Health Service Fee").value = DegreeData["Biological Sciences Division"].healthservicefee;
this.getField("Tuition Subtotal").value = DegreeData["Biological Sciences Division"].tuitionsubtotal;
this.getField("Health Insurance").value = DegreeData["Biological Sciences Division"].healthinsurance;
this.getField("Books").value = DegreeData["Biological Sciences Division"].books;
this.getField("Living Expenses").value = DegreeData["Biological Sciences Division"].livingexpenses;
this.getField("Other").value = DegreeData["Biological Sciences Division"].other;
this.getField("Living Expenses Subtotal").value = DegreeData["Biological Sciences Division"].livingexpensessubtotal;
}
I'm trying to have the selection "Astronomy and Astrophysics" - or whatever other degree program to autopopulate text fields: Tuition, Activities Fee, etc. Currently in my document, it only displays the data for Biological Sciences Division even when i am choosing Astronomy and Astrophysics.
Please HELP!
I am willing to send my pdf doc so you can see if (send me an email address).
Thanks,
Christine
It appears that you will be populating the various fields based on the selection from a drop down or combo box, so in the "Custom key stroke" your code should read:
Then for the drop down/combo box the custom keystroke code should be:
George Kaiser