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

107
Views
Cómo adjuntar detectores de eventos utilizando datos de jQuery QueryBuilder

Generé datos json de jQuery Querybuilder que me gustaría usar para adjuntar detectores de eventos automáticamente, pero después de intentarlo durante varias horas, no he podido encontrar la manera.

Aquí está el json de querybuilder de los elementos de un formulario html:

 let json = { "condition": "OR", "rules": [ { "id": "poll_8002", "field": "Question 1", "type": "integer", "input": "radio", "operator": "equal", "value": 2 }, { "id": "poll_8002", "field": "Question 1", "type": "integer", "input": "radio", "operator": "equal", "value": 4 } ], "valid": true, "then": [ { "id": "field-poll_8002", "type": "single", "action": "hide" } ] }

Aquí está el código que estoy tratando de generar usando json:

 $('input[name="poll_8002"]').on("click change", function () { var val = $(this).val() if (val === '2' || val === '4') { $('.field-poll_8002').hide() } else { $('.field-poll_8002').show() } })

¿Hay algún paquete/secuencia de comandos que pueda ayudar a automatizar esto en lugar de codificar con declaraciones if/else? ¿Cómo puedo conseguir esto?

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!