Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

424
Views
¿Cómo resolver un error de sintaxis de JavaScript en Adobe Acrobat?

Me han encargado convertir los formularios del sistema judicial para el que trabajo en archivos PDF rellenables. Se me pidió que hiciera que el campo "dirección" se completara automáticamente según la opción seleccionada en la lista desplegable "Sala del tribunal". No sé nada sobre codificación, así que busqué en foros hasta que encontré un tutorial que contenía este código.

 // 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; }

Intenté cambiar los nombres de los campos para que coincidieran con mi formulario y obtuve esto

 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; }

La cuestión es que sigue arrojando un error, "SyntaxError: falta: después de la propiedad id 1: en la línea 2"

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Sus claves de objeto tienen espacios, debe ponerlos entre comillas como esta:

 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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!