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

Javascript syntax error

New Here ,
Jul 08, 2019 Jul 08, 2019

Copy link to clipboard

Copied

i used this exact same script as a custom keystroke script on a different pdf and it’s not working now any help is appreciated.

case "PERIODIC EVAL E4 AND BELOW ICO:":

this.getField("Return").setItems(["MAIN ADMIN"])

this.getField("1").setItems(["MO"])

this.getField("2").setItems(["AMO"])

this.getField("3").setItems(["DIVISION OFFICER"])

this.getField("4").setItems(["DIVISION LCPO"])

this.getField("5").setItems(["DIVISION ADMIN"])

this.getField("6").setItems(["BRANCH CHIEF"])

this.getField("7").setItems(["LPO"])

this.getField("8").setItems([" "])

this.getField("9").setItems([" "])

this.getField("10").setItems([" "])

break;

TOPICS
Acrobat SDK and JavaScript

Views

291

Translate

Translate

Report

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 ,
Jul 08, 2019 Jul 08, 2019

Copy link to clipboard

Copied

Post the full script and the full text of the error message, please.

Votes

Translate

Translate

Report

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
New Here ,
Jul 08, 2019 Jul 08, 2019

Copy link to clipboard

Copied

SyntaxError: syntax error 1: at line 2

when I take out line 2 that is there I error travels!

Votes

Translate

Translate

Report

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 ,
Jul 08, 2019 Jul 08, 2019

Copy link to clipboard

Copied

That's the full code? If so, you're missing the "switch" command.

Votes

Translate

Translate

Report

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
New Here ,
Jul 08, 2019 Jul 08, 2019

Copy link to clipboard

Copied

Can you elaborate, I’m stuck because this worked as is on a different pdf.

Votes

Translate

Translate

Report

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 ,
Jul 08, 2019 Jul 08, 2019

Copy link to clipboard

Copied

LATEST

It couldn't have. The code is incomplete.

Here's more information about the switch method in JS: JavaScript Switch Statement

Votes

Translate

Translate

Report

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