Q:

Disable input if select option checked

  <select id="select">
      <option value="">select this </option>
      <option> 1 </option>
      <option> 2 </option>
      <option> 3 </option>
  </select>
   
  <input disabled type="text" id="p_amount">
  <input disabled type="text" id="pay_full">

$("#select").change(function(){
        if ($(this).val() !== "") {
         $("#p_amount").prop('disabled', false);
         $("#pay_full").prop('disabled', false);
         }
        else {
         $("#p_amount").prop('disabled', true);
         $("#pay_full").prop('disabled', true);
       
       //i means this value of select_option  is empty

        }
  });
0
$(document).ready(function(){
  $("select.form-control").change(function(){
    $(".home").prop('disabled', $(this).val() == 'home-none');
  });
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<select class="form-control">
    <option value="home-none">-</option>
    <option value="home-select">Team</option>
</select>

<div class="form-group">
    <input class="form-control home" name="h-p1-fn" placeholder="First name" type="text"/>
</div>
<div class="form-group">
    <input class="form-control home" name="h-p1-ln" placeholder="Last name" type="text"/>
</div>
0

New to Communities?

Join the community