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

303
Views
desmarque una casilla de verificación cuando marque otra - laravel

tengo un problema, necesito desmarcar una casilla de verificación cuando marque otra casilla de verificación. pero las casillas de verificación no deben tener el mismo nombre. el campo de nombre debe ser diferente.

 <input type="radio" class="new-control-input" name="custom-radio-1"> <input type="radio" class="new-control-input" name="custom-radio-2">

¿Cómo puedo hacer que se desmarquen?

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

0

Usando JavaScript puedes hacer algo como esto:

 function uncheckAndCheck(event) { // gets all radios with the name prefix like 'custom-radio-' // and uncheck all of them document.querySelectorAll( "input[type='radio'][name^='custom-radio-']" ).forEach( radio => { radio.checked = false; }); // checks the radio that triggered the click event event.target.checked = true; }
 <input type="radio" class="new-control-input" name="custom-radio-1" onclick="uncheckAndCheck(event)"/> <input type="radio" class="new-control-input" name="custom-radio-2" onclick="uncheckAndCheck(event)"/>

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!