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

427
Views
Menú desplegable dinámico usando 'cambiar' Javascript no funciona

Tengo este script a nivel de documento (simplificado) en un PDF:

 function SetFieldValues(){ var Model = this.getField("Model"); var Armor = this.getField("Armor"); var Winch = this.getField("Winch"); var Test1 = this.getField("Test1"); var Test2 = this.getField("Test2"); if(event.willCommit) { switch(event.value) { case "015305676": Model.value = "AMK23"; Armor.value = "YES"; Winch.value = "NO"; Test1.setItems[("Not Applicable")]; Test2.setItems[("-", "Serviceable", "Unserviceable")]; break; }}}

Este evento se inicia con la pulsación de tecla personalizada en la lista desplegable de inicio del formulario:

 if( event.willCommit ) { if(event.value == "-") this.resetForm(["Model","Armor","Winch"]); else SetFieldValues(event.value) }

Todos los campos se actualizan correctamente (Modelo, Armadura y Cabrestante); sin embargo, los cuadros combinados "Prueba" no se completan como se esperaba.

Luego lo probé de una manera diferente con esto (que pensé que sería genial usando una matriz ... pfft ... estaba equivocado):

 function SetFieldValues(){ var Model = this.getField("Model"); var Armor = this.getField("Armor"); var Winch = this.getField("Winch"); const ArmorArray = [field='Test1', field='Test2']; var ArmorArray; var CheckOptionsY = { Yes: [["-"],["Serviceable"],["Unserviceable"]], }; var CheckOptionsN = { No: [["Not Applicable"]], }; if(event.willCommit) { switch(event.value) { case "015305676": Model.value = "AMK23"; Armor.value = "YES"; Winch.value = "NO"; ArmorArray.setItems[(CheckOptionsY)]; break; }}}

Una vez más, los campos se actualizan sin problemas (Modelo, Armadura y Cabrestante), pero los campos "Prueba" no se actualizan con las opciones de la lista del cuadro combinado. ¿Qué hice mal? ¿Cómo puedo hacer que estos cuadros combinados de "Prueba" se carguen con las opciones apropiadas de 'Sí'/'No'?

about 4 years ago · Juan Pablo Isaza
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!