Answers for "disable click on select box"

3

jquery disable select

$('#pizza_kind').prop('disabled', false);
Posted by: Guest on May-29-2020
0

Disable input if select option checked

$(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>
Posted by: Guest on October-12-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language