Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

421
Vistas
How to resolve a JavaScript Syntax Error in adobe acrobat?

I have been tasked with converting the forms for the court system I work for into fillable PDF's. I was asked to make the "address" field auto-populate depending on what choice was selected in the "Courtroom" dropdown list. I know nothing about coding so I searched forums until I found a walkthrough that contained this code

// Place all prepopulation data into a single data structure
var DeptData = { Accounting:{ contact: "Steala Damuni",
                              email: "accounting@mycomp.com",
                              deptnum: "cmp1234" },
                 Engineering:{ contact: "Frank N. Stien",
                              email: "engineering@mycomp.com",
                              deptnum: "eng1234" },
                 Marketing :{ contact: "Shelly Oughtbuks",
                              email: "marketing@mycomp.com",
                              deptnum: "mkt1234" },
                 ITSupport:{ contact: "Goah  Wei",
                              email: "it@mycomp.com",
                              deptnum: "its1234" }};
function SetFieldValues(cDeptName)
{
  this.getField("DeptContact").value = DeptData[cDeptName].contact;
  this.getField("DeptEmail").value = DeptData[cDeptName].email;
  this.getField("DeptNumber").value = DeptData[cDeptName].deptnum;
}

I tried changing the field names so they would match my form and got this

var DeptData = { South Division Dept. 1:{ address: "20520 68th Ave. W. Lynnwood WA 98036"},
               South Division Dept. 2:{ address: "20520 68th Ave W Lynnwood WA 98036"},
               South Division Dept. 3:{ address: "20520 68th Ave. W. Lynnwood WA 98036"},
               South Division Dept. 4:{ address: "20520 68th Ave. W. Lynnwood WA 98036"},
               Cascade Division Dept. 1:{ address: "415 E Burke Ave. Arlington WA 98223"},
               Cascade Division Dept. 2:{ address: "415 E Burke Ave. Arlington WA 98223"},
               Evergreen Division Dept. 1:{ address: "14414 179th Ave SE Monroe WA 98272"},
               Evergreen Division Dept. 2:{ address: "14414 179th Ave SE Monroe WA 98272"},
               Everett Division Courtroom 3A:{ address: "3000 Rockefeller Ave Everett WA 98201"},
               Everett Division Courtroom 3B:{ address: "3000 Rockefeller Ave Everett WA 98201"},
               Everett Division Courtroom 3C:{ address: "3000 Rockefeller Ave Everett WA 98201" }};

function SetFieldValues(cCourtroom)
{
  this.getField("address").value = DeptData[cCourtroom].address;
  
}

Thing is it keeps throwing up an error, "SyntaxError: missing : after property id 1: at line 2"

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your object keys have spaces, you need to put them into quotes like this:

var DeptData = { "South Division Dept. 1":{ address: "20520 68th Ave. W. Lynnwood WA 98036"},
               "South Division Dept. 2":{ address: "20520 68th Ave W Lynnwood WA 98036"},
               "South Division Dept. 3":{ address: "20520 68th Ave. W. Lynnwood WA 98036"},
               "South Division Dept. 4":{ address: "20520 68th Ave. W. Lynnwood WA 98036"},
               "Cascade Division Dept. 1":{ address: "415 E Burke Ave. Arlington WA 98223"},
               "Cascade Division Dept. 2":{ address: "415 E Burke Ave. Arlington WA 98223"},
               "Evergreen Division Dept. 1":{ address: "14414 179th Ave SE Monroe WA 98272"},
               "Evergreen Division Dept. 2":{ address: "14414 179th Ave SE Monroe WA 98272"},
               "Everett Division Courtroom 3A":{ address: "3000 Rockefeller Ave Everett WA 98201"},
               "Everett Division Courtroom 3B":{ address: "3000 Rockefeller Ave Everett WA 98201"},
               "Everett Division Courtroom 3C":{ address: "3000 Rockefeller Ave Everett WA 98201" }};

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda