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

242
Views
JS on checkbox Change enable or disable a radio button

I have a check box that I want to enable these radio buttons. what I have does not work. how can I JS that?

im new. :(

var sipch = document.querySelector("input[name=sip]");
sipch.addEventListener( 'change', function() {
    if(sipch.checked) {
        document.getElementById("protocol").disabled=false;
    } else {
        document.getElementById("protocol").disabled=true;
    }
});
<input type="checkbox" name="sip" onsubmit="goPFive(event)" method="get">do this?
<input type="radio" class="testD" name="protocol" value="udp" disabled checked/>UDP
<input type="radio" class="testD" name="protocol" value="tcp" disabled />TCP
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

group your radio input with fieldset then set disabled attribute at fieldset element

<fieldset id="radioWrapper" disabled>
  <input type="radio" name="protocol" class="testD" value="udp"/>UDP
  <input type="radio" name="protocol" class="testD" value="tcp" />TCP
</fieldset>
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!