Copy link to clipboard
Copied
I've been tryin to resolve the issue on by myself but I guess I really need some help to figure out what is the stuff that I'm doing wrong. I'm not really a programming guy, just helping a friend to make his life easier instead of typing the values in the pdf manually. 🙂 All ideas and recommendation will be appreciated.
// Place all prepopulation data into a single data structure
var DeptData = { Sample Location:{ Street: "1604 Greens RD",
Destination: "Houston",
Consignee_Zip_Code: "77032" },
Sample LocationOKC:{ Street: "1000 N. Morgan Rd.",
Destination: "Oklahoma",
Consignee_Zip_Code: "73127" },
Sample LocationWTX:{ Street: "3707 S. County Rd.",
Destination: "Midland",
Consignee_Zip_Code: "73127" },
Sample LocationLAF:{ Street: "303 Ida Road",
Destination: "Broussard",
Consignee_Zip_Code: "70518" },
Sample LocationCAS:{ Street: "1849 Pyrite Road",
Destination: "Casper",
Consignee_Zip_Code: "82604" }};
var DeptData2 = { Sample Location_:{ Street02: "1604 Greens RD",
Destination02: "Houston",
Shipper_Zip_Code02: "77032" },
Sample LocationOKC_:{ Street02: "1000 N. Morgan Rd.",
Destination02: "Oklahoma",
Shipper_Zip_Code02: "73127" },
Sample LocationWTX_:{ Street02: "3707 S. County Rd.",
Destination02: "Midland",
Shipper_Zip_Code02: "73127" },
Sample LocationLAF_:{ Street02: "303 Ida Road",
Destination02: "Broussard",
Shipper_Zip_Code02: "70518" },
Sample LocationCAS_:{ Street02: "1849 Pyrite Road",
Destination02: "Casper",
Shipper_Zip_Code02: "82604" }};
function SetFieldValues(cDeptName)
{
this.getField("Street1").value = DeptData[cDeptName].Street;
this.getField("Destination1").value = DeptData[cDeptName].Destination;
this.getField("ZipCode1").value = DeptData[cDeptName].Consignee_Zip_Code;
}
function SetFieldValues2(cDeptName2)
{
this.getField("Street_2").value = DeptData2[cDeptName2].Street02;
this.getField("Destination2").value = DeptData2[cDeptName2].Destination02;
this.getField("Zipcode2").value = DeptData2[cDep2tName2].Shipper_Zip_Code02;
}
Copy link to clipboard
Copied
Check the Javascript console for errors.
Copy link to clipboard
Copied
All identifiers that contain a space must be placed within quotes, such as "Sample Location", but not SampleLocation, although I would recommend doing it any way.