Answers for "enable/disable radio button on selecting another radiobutton - jquery"

1

jquery disable radio button command

$(document).ready(function() {
  // By Default Disable radio button
  $(".second").attr('disabled', true);
  $(".wrap").css('opacity', '.2'); // This line is used to lightly hide label for disable radio buttons.
  // Disable radio buttons function on Check Disable radio button.
  $("form input:radio").change(function() {
    if ($(this).val() == "Disable") {
      $(".second").attr('checked', false);
      $(".second").attr('disabled', true);
      $(".wrap").css('opacity', '.2');
    }
    // Else Enable radio buttons.
    else {
      $(".second").attr('disabled', false);
      $(".wrap").css('opacity', '1');
    }
  });
});
Posted by: Guest on April-08-2021
1

jquery disable radio button command

@import url(https://fonts.googleapis.com/css?family=Droid+Serif);
h2{
  text-align: center;
}
hr{
  margin-bottom: 25px;
}
div.container{
  width: 643px;
  margin:50px auto;
  font-family: 'Droid Serif', serif;
  position:relative;
}
div.main{
  width: 320px;
  padding: 10px 60px 15px;
  box-shadow: 0 0 10px;
  border-radius: 2px;
  font-size: 13px;
  margin: 0 auto 50px;
}
span{
  margin-right: 17px;
  font-size: 15px;
}
input[type=radio]{
  margin:10px 10px 0 10px;
}
label{
  color: #464646;
  font-size: 15px;
  font-weight: bold;
}
Posted by: Guest on April-08-2021

Code answers related to "enable/disable radio button on selecting another radiobutton - jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language