mercredi 23 novembre 2016

How to disable / enable an input field with a checkbox

Current code:

<form>
  <div class="form-group" id="deadline" >
    <input type="text" class="datepicker form-control" id="deadline" name="deadline" placeholder="DD/MM/YYYY" >
    <input type="checkbox" value="ongoing" name="Ongoing" id="ongoing" >
    <label for="ongoing">Ongoing</label>
  </div>
</form>

how do i make it so that checking the "Ongoing" checkbox disables the "deadline" input field? Thanks ahead of time.




Aucun commentaire:

Enregistrer un commentaire