Copy link to clipboard
Copied
I would love some help on this one. I have used coding (Javascript) similar to this for some time now in Acrobat, but am self-taught and can't seem to understand how to fix this error. For reference, I use MS Visual Studio to write the coding, and that program is reporting no errors.
I am getting a syntax error in part of my code when trying to enter it into Adobe as a Document Javascript; I have omitted the code that comes before this as it does not seem to be an issue and is a lot of code. The error I am getting is: "SyntaxError: missing } after property list". But I can see the closed bracket at the end of my code, have attempted to re-type that portion of the code, and have tried to change some of the formatting around it as well. Nothing seems to get rid of the error and I cannot complete my document without this code. The code as a whole auto-populates several form fields with information when an item is selected from a dropdown list. Any insight would be greatly apprciated.
function SetFieldValues(cProdChoice) {
// Populate fields with values from the ProductBeingPackaged Object
this.getField("Product").value = Package[cProdChoice].ProdName;
this.getField("IFU").value = Package[cProdChoice].ProdInstr;
this.getField("Bag").value = Package[cProdChoice].BagProd;
this.getField("Box").value = Package[cProdChoice].BoxProd;
this.getField("RegulatoryLabel").value = Package[cProdChoice].RegLab;
this.getField("BarcodeLabel").value = Package[cProdChoice].ProdBCode;
this.getField("MasterPack").value = Package[cProdChoice].ProdMP;
this.getField("MasterPackQty").value = Package[cProdChoice].QtyMP;
}
Copy link to clipboard
Copied
There is no error in the script you posted. "I have omitted the code that comes before this as it does not seem to be an issue and is a lot of code." The syntax error should tell you which line the error is on. Go to that line in your script.
Copy link to clipboard
Copied
There is no error in the script you posted. "I have omitted the code that comes before this as it does not seem to be an issue and is a lot of code." The syntax error should tell you which line the error is on. Go to that line in your script.
Copy link to clipboard
Copied
The error is on the first line of the code I posted here. I omitted the code before it as the error was on this line.
If there is no error in the code, I am assuming it is an issue with Acrobat itself.
Copy link to clipboard
Copied
Resolved. There were a few errors in my earlier code which apparently threw this error on the wrong line and for the wrong thing??? Glad I had the time to go through word-by-word to fix it, this time.
Copy link to clipboard
Copied
That's what writing code is about. Checking the details and being thorough.
BTW: missing brackets and parentheses always indicate an error farther down in the code, because the parser can't know where an ending bracket or parenthese is supposed to be placed. That's your job.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now