Answers for "I want to enable textbox when checkbox is checked in jquery or javascript"

0

I want to enable textbox when checkbox is checked in jquery or javascript

function cash(cash) {
  if ($(cash).is(':checked')) {
    $('#cashAmount').attr("disabled", false);
  } else {
    alert("checkbox is not checked");
  }
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="col-md-12 field-option">
  <strong>Cash</strong> <input type="checkbox" name="cash" id="cash" onclick="cash(this)">
</div>
<div class="col-md-6 col-sm-6 custom_field">
  <!-- custom_field -->
  <span><strong>Amount <i>*</i></strong></span>
  <input type="text" name="cashAmount" id="cashAmount" class="form-control" disabled>
</div>
Posted by: Guest on October-12-2021

Code answers related to "I want to enable textbox when checkbox is checked in jquery or javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language