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

98
Views
El atributo deshabilitado no se elimina cuando la casilla de verificación no está marcada con jQuery

La siguiente secuencia de comandos agregará el atributo disabled a otros campos de entrada cuando el campo #alt_hp esté marcado, pero cuando desmarco el campo, el atributo deshabilitado no se elimina. No estoy tan versado en javascript y traté de dar sentido a otras soluciones en este sitio.

 <script> $("#alt_hp").change(function() { if ($("input[type=checkbox]").is( ":checked" )) { $("#new_displacement").val('') $("input#induction, input#heads, input#camshaft, input#turbo, input#boost, input#inc_displacement").prop("checked", false).prop("disabled", true) } else { $("input#induction, input#heads, input#camshaft, input#turbo, input#boost, input#inc_displacement").prop("disabled", false) } }); </script>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solo cambia la línea de abajo

if ($("input[type=checkbox]").is( ":checked" )) {

a esto

if ($(this).is(":checked")) {

Su código existente siempre se referirá a any/all casillas de verificación en todo el html. this se refiere a la casilla de verificación/elemento actual.

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!