5 Replies Latest reply on Jan 29, 2014 10:36 PM by judypleung

    syntaxerror: invalid label

    judypleung Level 1

      Hi,

       

      I am getting several errors that seem random, but currently it's "SyntaxError: invalid label 2: at line 3"

       

      I have included my custom keystroke and my document javascript. i have used this script before with no known errors, so i'm at a lost. previously i created my document on a PC and now I am on a MacBook Pro Retina 15" Mavericks Acrobat Pro (CS6).

       

      Can someone please help me identify the issue? I don't know or understand javascript. this was a formula that i found and worked for what i needed. Basically i have a drop down field; when i select my item (GL, GLPR, EABW, etc), the service description text field will auto populate as well as the price text field.

       

      i have tried reviewing this on a PC and the same error is occurring. thank you!!

       

       

      CUSTOM KEYSTROKE

      if( event.willCommit )

      {

      if(event.value == " ")

      this.resetForm(["Service Description 1","price 1"]);

      else

      SetFieldValues1(event.value);

      }

       

      DOCUMENT JAVASCRIPT

      // Place all prepopulation data into a single data structure var ServPrice =

      {GL:{ service: "General Listing", price: "105"},GLPR:{ service: "Free Promotional Listing", price: "0"},

      EABW:{ service: "Eighth Page Display Ad with black and white", price: "270”},

      QABW:{ service: "Quarter Page Display Ad with black and white", price: "455"},

      HABW:{ service: "Half Page Display Ad with black and white", price: "735"},

      FABW:{ service: "Full Page Display Ad with black and white", price: "1095"},

      EAFC:{ service: "Eighth Page Display Ad with full color", price: "540"},

      QAFC:{ service: "Quarter Page Display Ad with full color", price: "910"},

      HAFC:{ service: "Half Page Display Ad with full color", price: "1470"},

      FAFC:{ service: "Full Page Display Ad with full color", price: "2190"},

      EAPC:{ service: "Eighth Page Display Ad add color", price: "50"},

      QAPC:{ service: "Quarter Page Display Ad add color", price: "80"},

      HAPC:{ service: "Half Page Display Ad add color", price: "135"},

      FAPC:{ service: "Full Page Display Ad add color", price: "210"},

      CVIF:{ service: "Inside Front Cover Display Ad", price: "3900"},

      CVIB:{ service: "Inside Back Cover Display Ad", price: "3400"},

      CVOB:{ service: "Outside Back Cover Display Ad", price: "4900"},

      EDLN:{ service: "Edit Line in Display Ad", price: "35"},

      EDCC:{ service: "Edit Color Change in Display Ad", price: "60"},

      EDPC:{ service: "Edit Photo Change", price: "60"},

      NDEA:{ service: "New Eighth Page Display Ad Design", price: "125"},

      NDQA:{ service: "New Quarter Page Display Ad Design", price: "200"},

      NDHA:{ service: "New Half Page Display Ad Design", price: "275"},

      NDFA:{ service: "New Full Page Display Ad Design", price: "350"},

      PROF:{ service: "Each round of revision + one digital proof", price: "75”}};

      function SetFieldValues1(cServiceCode)

      {

      this.getField("Service Description 1").value = ServPrice[cServiceCode].service;

      this.getField("price 1").value = ServPrice[cServiceCode].price;

      }