Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

SyntaxError: invalid property id

New Here ,
Jan 14, 2022 Jan 14, 2022

I have tried to find what the invalid property id error is, and i can't find what it is.  I copied and pasted this directly from the article "Changing another field with combo box (drop down) selction". I renamed and deleted the email (i don't need it) and then put in the information i needed for my form.  No matter what i have tried I keep getting the same error on the same line

           SyntaxError: invalid property id 4: at line 5 - it was originally on line 4, so i tried replacing the : with a = sign and then going back and deleting the = and putting back the :.  It worked for that line, but it won't for Line 5. 

            I have attached a screen shots of the script that i am trying to use, and the information in the form.

 

Thank you in advanced for any help. 

TOPICS
How to , JavaScript , PDF forms
2.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jan 14, 2022 Jan 14, 2022
LATEST

Property ID's for an object cannot contain spaces or other punctuation unless they are enclosed in quotes.

for example

var oTest = {First Name:"Larry"}  // Incorrect, will cause syntax error

var oTest = {"First Name":"Larry"} // Correct, ID containing space is quoted

var oTest = {FirstName:"Larry"}  // Also Correct because ID does not contain a space

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 14, 2022 Jan 14, 2022
LATEST

Property ID's for an object cannot contain spaces or other punctuation unless they are enclosed in quotes.

for example

var oTest = {First Name:"Larry"}  // Incorrect, will cause syntax error

var oTest = {"First Name":"Larry"} // Correct, ID containing space is quoted

var oTest = {FirstName:"Larry"}  // Also Correct because ID does not contain a space

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines